Stop ASP.Net Development Server spinning up when using Azure Emulator - debugging

I am using The Azure Emulator for test deployment of an ASP.NET Web API application. When I run this I notice that the asp.net dev emulator also runs. As this does not seem to be needed, is there a way to stop it from spinning up?

There are couple of things to understand with Windows Azure ASP.NET Web role application:
When you have your Web Role set as "Startup Application" or you run ASP.NET web Role application only, you you will see the ASP.NET site runs at http:\localhost:XX this is because you are running your web application directly in IIS without any relationship with Azure Compute Emulator.
When you have your Windows Azure project set as "Startup Application" or you launch your Windows Azure application directly, in that case your ASP.NET web application will run within Windows Azure Compute Emulator. In this scenario the Compute Emulator will start if not running and if running then the ASP.NET web application will still run with IIS however due to virtual load balancer scenario you will see the ASP.NET web application is running at http://127.0.0.x:XX.
So depend on how you launch your project within your solution you will see different execution. When compute Emulator is running you can open its UI to understand how your different instances are running.
Finally based on your above requirement it seems you just want to test your application in IIS only so if you just set your ASP.NET web role to "startup project" you will not see compute emulator activity.

Related

Deploying .Net Core WebAPI project on IIS

I have created a simple web API using .Net Core and trying to publish it to IIS. But getting HTTP 500.
I followed https://docs.asp.net/en/latest/publishing/iis.html article and did exactly whatever mentioned in that.
I Installed only https://www.microsoft.com/net/download as
DotNetCore.1.0.1-WindowsHosting.exe OPT_INSTALL_REDIST=0
NOTE : I am able to deploy and access MVC application successfully but cannot access WebAPI application with the same steps.
In the IIS logs i am seeing below error.
Failed to start process with commandline '"dotnet" .\Project-1.dll', ErrorCode = '0x80070002'.
I am using the default web api template provided in Visual Studio 2015
am i missing something. Is WebAPI deployment is different to MVC app deployment w.r.t .net core ?
When you install the .NET Core Windows Server Hosting bundle, it won't restart all of the IIS processes if IIS is currently running. This is a good thing, since on a production server you wouldn't want them just to restart, but it would be nice if it was made a little clearer. First, check your System (not User) PATH variable to ensure that the path to Dotnet is there. Then, go into services and restart the Windows Process Activation Service. This will restart all of the IIS bits and get it to update the path. Once you've done this, IIS should serve up your .NET Core app just fine.

How do I deploy an existing web app project to Azure using Visual Studio but no Azure Emulator?

I have an existing project with three web apps (two web API and a front end). I would like to deploy to Azure all three with a single click of Publish using the Publish Web wizard.
I installed the Azure SDK and tried to create a new Cloud Service, but this install the VMs and the storage emulator, that I don't need at all and slows down my PC.
I tried with Azure Resource Group to add to an existing project, but the Deploy button remains disabled, like it failed to connect to the web site project.
What is the recommended way to do this?
I am using Visual Studio 2015
Thx.
You do not need to install the emulator for the deployment to work, just download the parts you need from http://www.microsoft.com/en-us/download/details.aspx?id=48178 (assuming you want SDK 2.7).
It's not really clear from your question if you want to deploy a Cloud Service or a Web App. If you want to deploy a Cloud Service, you can add all 3 projects as roles and they will all be published within a single deployment (just one click to Publish). But, if what you want is to deploy them as web apps, you will need to do it in 3 different apps, which means 3 clicks to publish.

Silverlight OOB App and Web Service in same Solution

I'm using vs2012 and have created a Silverlight 5 out of browser application that talks to a MVC 4 webapi web service for its data.
With both projects in the same solution I can successfully fire up and test the silverlight application with the web service if I have the web service set as the startup project and have the application running in the browser and embedded in a view on the MVC web service site. If I set the silverlight application as the startup application so that I can run it out of the browser like the user will, then the MVC site doesn't get started and the web service isn't available to connect to.
Is there anyway to have both projects running in the same instance of visual studio, but have the silverlight app run out of browser?
Try this:
Right click on solution from Solutin Explorer and select Properties. Then select the Multiple startup project option inside Common Properties/Startup Project and set both as 'Start'. Close and Start Debug again.

How to attach to and debug an ASP.NET MVC application running in Windows Azure Emulator?

I am writing an MVC 3 application to run in Windows Azure. On my local machine I use the Windows Azure emulator.
If I press F5 in my solution ("Start debugging") I'm able to put breakpoints and step through the code of my application.
Do you know if it's possible to attach to the application if it's already running (if it's been started with CTRL + F5, "Start without debugging")? If yes, how?
In ASP.NET running in IIS I just have to attach to the w3wp.exe process. How to do the same for the Windows Azure emulator?
If you are running the application in IIS (have a Sites section in your config file) then you will do it the same way with the emulator. Azure creates an Application Pool for the deployment so you will just need to attach to that w3wp.exe process.

VS2010 - Debugging a silverlight 4 OOB with breakpoints in the WCF services

I created a silverlight 4 app , and chose to host it in a ASP.NET Web Application.
I added a Silverlight-enabled WCF Service to the Web Application Project.
The Web Application project is now set to be the startup project.
This way every thing works fine and I can stop at breakpoints in the WCF services in the Web app project, and also stop at breakpoints in the silvelight project.
In the silverlight project properties, I changed it to be an OOB. This causes the startup project to automatically jump to the silverlight project. OK, so now when I debug the silverlight app it's opened OOB, but now I cant put breakpoints in the WCF services in the Web app project (Although the silverlight client can communicate with the web app project) . So I changed the startup project to the Web app again. But now the silverlight app doesn't start as OOB.
How can i debug in the WCF services, and run it OOB at the same time ?
(My app is designed as an OOB, so it's important for me to develop it that way).
First, You have to set a breakpoint on your client side, right before you call a service operation.
Second, set another breakpoint inside the service method on the server side.
Now, when you start debugging and hit the first breakpoint, attach the dev server process to the debugger by doing the following steps:
click Debug - > Attach to process
select the Webdev process and click attach.
now when you continue to debug, you will be able to debug your service as well :)
When you start debugging, you should go into Visual Studio and manually attach the debugger to the development web server (Debug->Attach to Process...). This step is not done automatically when debugging OOB.

Resources