Debugging Azure: Error attaching the debugger to the IIS worker process - iis

I have a web application asp.net to deploy to Windows Azure. I try to run it on local first. But when debugging, I catch this error from VS2010:
"There was an error attaching the debugger to the IIS worker process
for URL 'http://127.255.0.0:82/' for role instance
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0'.
Unable to start debugging on the web server ......."
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me.

I had similar problem with Windows 8, debuging a cloud application with Visual Studio 2012 RTM and Azure SDK 1.71, when trying to launch the application into the compute emulator. It was a very simple app, but I used Azure diagnostics. At the end these are two things I have changed that have work for me, both turning on Windows 8 features (so go to Win8 and open 'Turn Windows Features On/Off'.
Activate the checkboxes for:
Internet Information Services Hostable Web Core
Internet Information Services > World Wide Web Services > Application Development Features > ASP.NET 4.5
Internet Information Services > World Wide Web Services > Health and Diagnostics > Tracing
Internet Information Services > Web Management Tools > IIS Management Scripts and Tools
That worked for me, it makes sense, as I'm using Visual Studio 2012 and trying to get some trace information using diagnostics in Azure.
I hope this will work for you or give some tip about the problem. In the case of being useful information, remember to vote as response or as value tip.
Thanks,
Mike

This usually happens when there's a problem with the project to be deployed to the emulator (WindowsAzureProject2 in your case).
Try the following:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log file for the error messages. See more details in this answer.
Make sure your project can be started without the emulator. It's a web project, so just try to start it as a regular web project. Or publish it to the separate folder and try to create a website in IIS of it.
Check your *.csdef and *.cscfg files to make sure all the configuration is correct.
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to deployment16(6).WindowsAzureProject2.WebApplication3_IN_0, right click --> Explore.... Make sure that this folder is not empty and contains all the files required to start a web project successfully.
BTW, there's a similar question: Debugger can't connect when starting local azure project

Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk

I just have today the same problem trying to Debug locally with Azure Storage Emulator in Windows 7. So in the Azure project properties, in Web tab, I checked the radio button 'Use IIS Express' and it debugged without problem. I hope this helps someone.

I encountered this exact same problem when I upgraded an existing Azure solution to the Azure SDK 2.1. After some hunting around I uncovered that the upgrade had automatically set the "Local Development Server" setting to "Use IIS Web Server".
Changing the "Local Development Server" setting to "Use IIS Express" fixed the problem immediately.
To access this setting right-click the Azure cloud project file in your solution, select the "Properties" option, tab down to "Web" and you'll see the following setup.

Also, make sure you run Visual Studio as administrator

Please check the version of emulator you have installed. If your code is created in older sdk and you have a new emulator installed it will give you this error.

Check the version of Azure APIs in your project, go to Project > references and right click on Azure dlls to check the version, same sdk version must be installed on the system, higher are optional as azure 2.x are not backward compatible.

Related

Visual Studio 2015 Preview - Full IIS

Any idea how to run ASP.NET 5 project in full IIS (not express) from within Visual Studio 2015 (via start debugging with F5 key)?
Atm I'm getting:
Couldn't determine an appropriate version of KRE to run.
I know it's not officially supported yet, but since IIS Express can do it, so should full IIS?!?
Let's say you created an ASP.NET 5 web application out of the template provided in VS 2015 Preview, then you can follow either of the approaches below:
Run the kpm pack command to create the deployable package with the appropriate options.
Example:
kpm pack --runtime KRE-CLR-x86.1.0.0-beta2-10690 --out "C:\MyWebApps\WebApplication1" --wwwroot-out wwwroot --configuration Release
Right click on the web application project and do a Publish to local file system directory.
Once the above step is done, in IIS, you can create a virtual directory application (or Website if you wish) to this deployable package's wwwroot folder. Example: "C:\MyWebApps\WebApplication1\wwwroot"
I just had a similar issue with beta4.
Note that the names have changed now so instead of a KRE it's now a DNX, although IIS was still showing the error calling it KRE despite this.
Anyway the solution for me was to:
right click the project in question in Solution Explorer
select "project name" Properties
tick Use Specific DNX version
tell it exactly which one you want to use, for me that was 1.0.0-beta4, .NET Core, x64
The project then ran in the browser for me.

IIS Web Deploy's "Import/Export Application" Action Missing?

I had a working IIS 7.5 with Web Deploy 3.5 configuration such that the "Import/Export Application" feature in the right hand action pane showed up and functioned properly. Unfortunately I had to remove and reinstall IIS, and now the Import/Export functionality does not show up in the Actions pane, as if Web Deploy was not installed.
I tried to reinstall using the automated installer at http://www.iis.net/downloads/microsoft/web-deploy, but when I run it, the installer seems to think that Web Deploy is already installed and does not offer me any reinstall/uninstall option.
How can I force a reinstall of WebDeploy or force IIS to recognize that Web Deploy is still installed?
Go to http://www.iis.net/downloads/microsoft/web-deploy
Scroll to the bottom of the page to the "Download Web Deploy" header
Click the x86 or x64 link next to your language of choice. Do not click the WebPI link.
Once downloaded, click on the installer to open it.
Click Next
Click the Remove button
Now you can reinstall it using the Web Platform Installer, or just use the standalone.
On a side note...
If you don't see the Deploy options in IIS once you've reinstalled Web Deploy, try running IIS as Administrator. Hope this helps.
I am running IIS on my development machine on Windows 7. Web Deploy 3.6 seem to break something as the Import / Export Application options are not available. Had to uninstall 3.6 via control panel add/remove programs and then install 3.5 via Web PI.
I've installed Web Deployment Tool 2.1 then restart IIS Manager and the Import/Export Application appeared.
I was running a 'gallery template' Windows Server 2012 VM on Azure. Web Platform Installer said Web Deploy 3.5 was already installed. At first I thought this neat feature had been removed/moved.
In Add/Remove Programs, saw that Web Deploy 3.6 Beta was installed. Removed it and reinstalled 3.5 (without SQL stuff) via Web PI.
Ran IIS Manager as admin and all works fine.
Update - A new Azure VM also had this problem, but had 3.6 Beta3 installed. Again, removed and reinstalled 3.5 via WebPI.
None of the other answers here fixed this for me with Visual Studio 17 on Windows 10. The fix was here: https://developercommunity.visualstudio.com/content/problem/230372/web-deply-40-msi-location.html
Web Deploy 4 has moved to be distributed with Visual Studio 2017. This is nuts because the Web Deploy service and the Import/Export tools are for server administrators and not devs. The discussion in the link says they are working on adding Web Deploy 4 to the Web Platform Installer, but have encountered a few issues (read: we didn't create a proper deployment for it the first place.)
The fix for me was to uninstall Web Deploy 4 from Control Panel-Apps & features, then reinstall from the MSI provided with Studio. Look in C:\ProgramData\Microsoft\VisualStudio\Packages for a folder like Microsoft.VisualStudio.WebDeploy.Msi,version=...,chip=x64. The MSI file is within that. More detail in the link I mentioned.
My guess is if the IIS Manager is not turned on at the time Studio (and therefore Web Deploy) is installed, the hook for Import/Export can't be created.
My situation is slightly different as I never had the import/export menus. For what it's worth:
I tried to install the Web Deploy installer. It said that a newer version was installed. I tried repairing Web Platform Installer. Nothing changed. I tried changing but was told there were individual components. I tried uninstall/reinstalling WebPlatformInstaller.
After that, the IIS Manager showed a Web Platform Installer icon under the Management section after restarting, but still no Deploy menu on the right click.
Double-clicking that icon started the installer where I could then search for web deploy. There was a Web Deployment Tool 2.1 that was not installed. Clicking Add then Install and restarting IIS Manager (not run As Administrator) was all that was needed to get the Deploy menu:
According to this Microsoft document, the Web Platform Installer should have started automatically. Never did. But it is in the start menu. The steps are the same weather you start it from IIS Manager or standalone.

Debugging Azure: window popup says The web browser can not be started

I have a web application asp.net to deploy to Windows Azure. This application contains one web role. I try to run it on local first. But when debugging, I catch this error from VS2010: "Window Azure Tools for Microsoft Visual Studio
The Web Browser can not be started. To resolve this problem, you must restart Windows."
I have restarted windows several times, but there was no luck.![enter image description here][1]
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me. Please help me! Thanks a lot. Best Regards.
There could be two problems:
Problem with your IIS settings: It is possible that there is a problem with your IIS in your machine which could not be restarted when VS2010, wants to run it.
To verify it what you can do it launch your Web Role using "View in Browser" setting and see if your Web Role can run in IIS, you will see the web role started in a URL as http:\localhost:XXXXX and that would be the first step to resolved.
Problem will your Windows Azure SDK which could not launch the WebBrowser to run in IIS
If you don't have problem in this step #1, then it is possible that Windows Azure SDK has some problem trying to start your IIS from external process and this could be caused by corrupted SDK installation or any other reason.
If that is the case try:
remove all Windows Azure SDK components from your machine.
Restart the machine, Install Azure SDK from here for VS2010
After SDK install, restart the VS2010 in admin mode and try created a hello world webrole and see what happens.

Debugger can't connect when starting local azure project

Ok, first of; here's what I did:
Install AZURE tools
Reboot
Start Visual Studio - new Azure project
Add web role (asp.net MVC 4 beta web role)
Hit F5 (debug)
It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn't connect.
Then after some googeling I'm suggested to try to run the application without running the debugger to see if I can acces the application. When I do I get this:
So I figure that IIS does not have permissions to access some file/directory. So I go to IIS and look up the application pool running the app, and it tells me that the identity in use is NetworkService, then I go give NetworkService full permissions to the entirety of the folder IIS has set for the application (which also happens to be the path to the project dir). Still I get the same error. Now I'm more or less out of ideas, but I try one last thing, which is to also give IUSR full permissions to the same dir, but this did not help either.
How can I go about resolving this problem? I haven't tried actually launching my project to Azure yet, cause if I can't even get it to work in development I don't see much point. Any and all help would be appreciated.
I ran into the same error today after uninstalling .NET 4.5/Visual Studio 11 Dev Preview, then installing ASP.NET MVC 4 Beta (this is before Feb 29th when the updated VS 2011 Preview drops).
Since I uninstalled .net 4.5, you just need to do an "aspnet_regiis -i" to ensure the .net framework (4.0) is set up with IIS 7.x this worked for me.
Edit: This will work if you uninstall/then manually install Visual Studio 2012 RTM as well.
I had a similar error yesterday. For me the problem was that the output of the build was empty in the target folder.
I tried to answer a similar question https://stackoverflow.com/a/9411422/182371:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log
file for the error messages. Mode details at
https://stackoverflow.com/a/8432621/182371
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0', right
click --> Explore.... Make sure that this folder is not empty and
contains all the files required to start a web project successfully.
As for the Access Denied error:
it could be just an IIS default setting to disable browsing. To resolve that, just navigate to that web site in IIS, find Directory Browsing icon, and press Enable. You will at least see the files inside that directory.
Also try not only 127.0.0.1:81, buta specific document inside that folder, like 127.0.0.1:81/Default.aspx
Take into account the fact that there's sometimes some mess with the ports. You see that in the error message it's port 82, but in your browser it's port 81. So make sure you're using the right port. Or, even better, in your service definition try to use some non-standard port for this to avoid remapping.
I've met the same issue. In the end, I had to reinstall IIS 7.
I got this exact same error and tried a re-install of IIS and the Azure SDK - nothing worked.
Eventually tracked it down to the "IIS URL Rewrite Module 2". I went to the Control Panel and chose Repair and it resolved it. If you have a section in your web.config then this might be the cause.
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk when upgraded from 2011.

Azure - error on starting with multiple web role projects

If I have more than one webroles(projects, not instances) in my application, I get this error: (I only get it if I attach a web role. It works fine wit as many worker roles projects as I want)
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5100/' for role instance 'deployment(21).CloudPOC.WebRoleToHostDataService.0'. Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Click Help for more information.
OK
What is wrong here? I can't understand it and I need a webservice project!
Make sure you are starting the Azure project rather than the Web Project itself. You might have set the Web Role as the startup project, and if you do that you'll find that IIS runs the Web App rather than the Azure Dev Fabric, meaning any Dev Fabric specific stuff (like config settings per role) aren't available causing problems.
What you're meant to do is let the Azure Dev Fabric (Compute Simulator) fire up all your roles for you, and it'll also work out if it needs to open a web browser etc.
So right click on the Azure Cloud project, set that as the Startup Project, and try again.
Hope that helps,
Andy
EDIT thought of something else!
Make sure your web.config is compiling to allow debug="true". If you have added a new WebSite to your solution, it won't be so by default:
<system.web>
<compilation debug="true" targetFramework="4.0" />
I had similar issue which got resolved with following steps.
Make sure you have correct version of .net framework 4.0 is intalled. (.Net Framework 4.0.30319 is the latest version)
Uninstall if there isany other .Net 4.0 framework in present on your system by going to Add And Remove programs.
Go to %windir%\Microsoft.NET\Framework64 physical location and remove unwanted .Net framework 4.0 folder
I've also had this problem and it happened when I upgraded my app to 4.0... I ran without debugging and got the following error:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
and after researching that error, I found this:
http://forums.asp.net/t/1571308.aspx/1
which says there's currently a bug w/ vs2010 and 4.0... I took the answers recommendation and commented out the extensions section and it worked for me... Another possible solution.

Resources