How to deploy a Web Service from Xamarin Studio - asp.net

Good afternoon, everyone.
I'm running Xamarin Studio (Mac OS) and I need to deploy a Web Service in order to build a safe communication with a MySql Database which my Xamarin.Forms app depends on
So far I've opened a new solution and added a new "Web Service with CodeBehind" from the ASP.NET Web Forms palette.
Now I have all template stuff: a DataWebService.asmx with a single line and a DataWebService.asmx.cs with an empty class inheriting from System.Web.Services.WebService.
Now, all I want is to learn how to deploy this Web Service so it can be imported by my other App and consumed.
(I do have a domain to deploy it to, but I won't mind localhost)
In order to make things as simple as possible, a HelloWorld application will do just fine.
----- Extra comments:
I suppose this is pretty much everything I'd have to do in Visual Studio, but I'm avoiding the need of another machine - even a virtual one, once I don't have a Windows license.
It seems to me that a wizard should be able to do the rest, but apparently there isn't such a thing in Xamarin Studio (which I'm hoping to be wrong)
The CodeBehindService.asmx.cs lacks the [WebService] directive I've seen on my research so far, which makes me think Xamarin Studio is still incomplete and can't support me in this task
I don't mind doing some work myself, though I'm not sure of what would be needed. My priority is: deploy
What I have: an almost empty asmx file; a dll binary
What do I do with it?
I tried simply uploading them but the "Add Web Reference" wizard asked for a discovery file; as you can see I lack the basics.

Related

Precompile ASP.NET MVC views on Azure Web App

Is there a way to precompile the ASP.NET MVC views on an Azure Web App (specifically when published via Release Management on VSTS)?
Once each view has been hit once, the page subsequently renders very quickly. But that first delay can be a doozy for users and there's no way to script touching each page.
I'm not sure if I need to change something in the build/release processes on VSTS (I am using the Visual Studio Build build step and the Azure Web App release task) or if I need to run something on the Azure Web App instance after it is released (or something else altogether).
It seems like finding some way to call aspnet_compiler after publish might be what I need (and I have seen that in reference to Web Roles on Cloud Services) but I can't get that to work.
Calling
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler -v "/" -p "d:\home\site\wwwroot"
via the Console in the Azure Portal executes just fine (and finds errors if there are any) but doesn't have any impact on startup time - hitting a view the first time still takes a long time.
So maybe that isn't the right direction.
I've looked at RazorGenerator (including the .MSBuild nuget package) and I couldn't quite get it to work, but really I was hesitant to make so many changes to the projects just to get precompilation on release.
Also note that I am currently using TFVC, not Git, in VSTS, so the Kudu/Git integration (that does seem to trigger the precompilation according to some articles) isn't available to me as far as I can tell.
Other ideas?
You can add "/p:PrecompileBeforePublish=true" argument in "Visual Studio Build" step:
Then the task will call aspnet_compiler during the build process and generate a precompiled output for deployment.
In visual studio 2013+, choose Build->Profiles. Select the profile, then choose "Settings". Underneath "Configuration", expand "File Publish Options", and then check the "Precompile during publishing" option.

Running ASP.Net server - Must be from visual studio?

I'm pretty new to ASP.Net and I've been having troubles understanding something.
I made a web application project with a web service on my computer.
I made another web application project, who then consumed the WSDL from the web service on the first project and uses a function in it.
I ran each on a different VS2012 Instance and when both projects are running in then there is no problem and it works fine.
When i close the VS Instance with the Web Service project then I get a Coonnection Error which is also logical.
My question:
Is there a way to keep the server running without keeping visual studio open?
There is no ".exe" generated or anything so I don't know what to run in order to keep the "Server" running..
Additional question if you don't mind:
If I want to use this service from another computer on the same Network, will the "localhost:.....?WSDL" service reference still work or do I need another address?
Sorry for my lack of knowledge, I just couldn't find a good guide explaining about how to keep the server running anywhere.
Thank you, Mellor.
Host your web service in localhost
use the computername instead of localhost in WSDL URL when you add services/web reference in cleint applications

can azure web role instantiate an activeX component?

I have an asp.net website that I'm looking to migrate over to Azure. I have been doing some analysis of the website and code to understand issues with the migration. I am confident that 95% of the code will be fine as most of it is pretty standard web forms and dot net programming.
However, I have just run across an ActiveX component that is installed into the \windows directory on the webserver.
I am wondering if this will be an issue for the migration? There could easily be a number of follow-on questions as well depending on the answer. How do Azure web roles handle instantiation of activeX server components? Can I include the DSINTX.OCX file into the solution or do I wrap it in a dotnet assembly?
private DSINTXLib.Dsintx m_dsintx;
...
m_dsintx = new DSINTXLib.DsintxClass();
Installation of the ActiveX component should not be difficult. You can use a startup task running elevated to install it, assuming that there's an unattended installation mode for it. I blogged about this process for a Windows Service a while back.
http://blogs.msdn.com/b/golive/archive/2011/02/11/installing-a-windows-service-in-a-worker-role.aspx
If you don't have an installation file, then create a script that installs and registers the control and then use RDP to your role instance to debug. The blog post goes over some of these techniques as well. (Use notepad to create the command file, not VS.) You can add the OCX to your project, but be sure to set the Copy Local property to True so it becomes part of the package that is sent to Azure.

Edit and Continue in ASP.NET MVC 3 application

Is it possible to Edit and Continue in ASP.NET MVC 3 app using Visual Studio 2010? If so, how can I do that?
btw, my OS platform is x86.
Edit: when I hit f5 and then try to edit the code I receive the following error: Changes are not allowed while code is running or if the option 'Break all processes when one process breaks' is disabled. The option can be enabled in Tools, Options, Debugging.
Even though the option is enabled I cannot edit my code when code is running.
After a lot of messing about, googling, and (essentially) guess work, (I am actually running x64 environment) I found that the following enabled MVC 3 edit and continue for me Great !
Setting all the projects to x86 in configuration manager
Setting my WebApp project output path to "bin" in the properties window
Setting my WebApp project to use Visual Studio Development Server
(project properties > Web tab)
following the 2 simple instructions from Pro ASP.NET MVC 3
Framework, Third Edition
Now I can set a break point, then hit F5, then when the break point hits - I can change my code (e.g. in controllers or class library projects referenced by the MVC web app), and continue debugging (F5 again) and the changes are picked up, and everything seems to be as it should !
Further to this, you'll find that Edit and Continue will not work on certain methods -- those with dynamically-typed variables and those with lambda expressions. You'll probably have a lot of lambda if you're using LINQ to (anything) to retrieve data from repositories, and of course ViewBag is a common dynamic in MVC applications.
So, Edit and Continue and MVC mix poorly. Which is all right, really, because it gets you into the habit of test-driven development -- write good tests, code to pass the tests, and only then build and run.

Best ASP.NET application Deployment method

Which is the best method to deploy a web application. Currently i am publishing the application and placing that folder in the server and creating virtual directory and providing windows authentication.
I just want to know this is a better metod to deploy or i need to use any other deployment technique?
Plese suggest
It really depends on the situation. For some situations, using Visual Studio's publish feature (right click project) works great. However in some situations, particular larger organizations or environments where the infrastructure group and development team are a little more isolated, you need to use a Web Application Installer or an MSI package. I've also had instances where the easiest thing to do was create a simple .bat file and create an external command in Visual Studio.
Use a web application installer, easy to create with Visual Studio.
If you need a third person to deploy your application in production servers, I would suggest you to deploy using a MSI, it would also help you to version your release.
MSI can be created using various ways including but not limited to
Deployment projects in VS studio
WixGen
Click once

Resources