visual studio error attaching debugger - visual-studio-2010

I just set up my machine to code Windows Azure apps in Visual Studio 2010. I have a machine at work, which works fine. The machines are both 64-bit Windows 7. I run as administator at work. At home I installed most of the VS and .NET components as normal user, but I'm running everything now as administrator, because I assume there could be some errors correlating to that.
Creating a standard Azure project with one web role gives me this:
"there was an error attaching the debugger to the IIS worker process
for URL http://127.0.0.1:5100/ for role instance 'xyz'...".
I searched Google 24 hours and tried most of the solutions, but none worked for me:
repairing .NET 4.0 (I didn't uninstall it prior to reinstalling, but
I will try to do so now)
setting the WebRole as Start Project works fine. It runs the webpage.
<system.web> <compilation debug="true" targetFramework="4.0" /> is set to true ( http://www.google.de/url?sa=t&source=web&cd=4&sqi=2&ved=0CDgQFjAD&url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F4541593%2Fazure-error-on-starting-with-multiple-web-role-projects&ei=RAhOTq27Fsv4sgaB_LSVAw&usg=AFQjCNFa6NveaRmUhBtEIus9vwK54VojKA)
there's no httpModules to delete ( http://natacha-huguet-millot.tumblr.com/)
there's only one v4.x directory in Windows\Microsoft.NET\Framework64 ( http://social.technet.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/45e01c3d-7c16-4ca7-999b-46cb20b38c1d#0c118416-484a-413c-bd18-049033b1ccb8)
running aspnet_regiis.exe -r. succeeds but doesn't work ( http://www.dotnetspark.com/kb/3720-error-attaching-debugger-windows-azure-sdk.aspx) neither does rebooting
looking for Visual Studio Web Debugger log shows this (also my section name="httpErrors" overrideModeDefault in IIS is set to Allow; source: http://dunnry.com/blog/2011/07/14/HowToDiagnoseWindowsAzureErrorAttachingDebuggerErrors.aspx):
http://127.0.0.1:5100/debugattach.aspx
Status code=403 (Forbidden) Protocol version=1.1 Cached=False
Content-Length=53 Content-Type=text/html; charset=utf-8
Date=Fri, 19 Aug 2011 20:16:48 GMT Server=Microsoft-IIS/7.5
X-Powered-By=ASP.NET
/debugattach.aspx-application debugging not activated.
When I comment out the Sites-Tag in the ServiceDefinition.csdef I get the following error:
"unrecognized attribute 'targetframework'. note that attribute names
are case-sensitive"
Here I also tried most solutions to be found on the internet:
setting the right .NET-Framework version in IIS-Manager (all application pools are set to 4.0, when starting the project, the error page shows framework 2.0 though, where can I change it?)
installing the newest .NET-Framework, I have 4.0.30319
None of them work.
If you have any advice, I will try it and list my result in this post.

I was getting this due the the properties on the azure project being set up incorrectly.
I had to change the setting from IIS Webserver to IIS Express

The first question to ask is which version of Windows 7 are you running at home? I'm going to go out on a limb and guess that it's Home Premium and at work you run Professional.
The catch is that with Home Premium (an lesser edtions) you don't have the option to install the necessary components to be able to debug in IIS. To confirm this, on your work computer go to Control Panel -> Programs and Features -> "Turn Windows features on or off" and have a look under the IIS option. You'll see more there than you do at home.
I have not found anywhere in the MS documentation on the differences between various editions of Windows 7 that this is the case. I'd be happy for someone to correct me on this though.
To get around this issue is while running at home to change the project to run with Visual Studio Development Server (right click your project -> Properties -> Web) and make sure that you change it back to using IIS before you check in your code.
Or you can buy an anytime upgrade for windows to Professional.

Got the same error and fixed it by changing the defaults for the app-pools in IIS.
Start iis manager
Select application pools
On the right side, in the 'Actions' panel click on 'Set application pool defaults'
Set .NET framework to 4.0
OPTIONAL : Set Enable 32-bit applications to true

This worked for me:
Go to IIS -> default web site -> bindings
Set the default http port back to 80.

Related

The Web Server Could Not Find the Requested Resource visual studio debugging

Issue
I have a .net 4.0 Web Application running in visual studio 2012, every time I go to debug the site i'm receiving the following error:
The Web Server Could Not Find the Requested Resource
What I've tried
I've followed microsoft's website with solutions: msdn
From a command prompt window, run the following command: systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i
I've also attempted to remove the .csproj.user files
Since we use Source Control i've deleted all items, the site and apppool and reconfigured from scratch.
AppPool is set to allow 32-bit applications
All to no avail...Anyone have a solution that might solve this visual studio debugging nightmare for me?
Steps:
Close all solutions in Visual Studio
open IIS7 (run > inetmgr)
Click your top node (computer name)
Open the "ISAPI and CGI Restrictions" option
check if your .Net version has the correct restriction (for example, if you're working with 4.0 is should be on "Allowed")
I was getting the same error when i was running the ASP.NET project from the IIS. I resolved this issue by configuring IIS.
Go to run
type appwiz.cpl and press enter.
Look for "Turn windows features on or off" and click on it
now windows will open for Turn windows features on or off
look for Internet Information service and select that option.
go to world wide web service under the Internet Information service branch
expand Application development feature
Select all the ASP and .net version. and click on OK.
now try running the application from asp.net , it will work :)
I had the same symptoms but a completely different problem. I had attempted to install Url Scan and it didn't seem to work correctly as I could not find the .ini file to edit settings within. I had forgotten that I had installed it, but it appears by default it will prevent debugging from working.
Uninstalling Url Scan solved the issue for me. To uninstall it I had to right-click on the .msi file and choose Uninstall. Url Scan did not show up under the "Add or remove programs" section.

IIS Express Web Server - (Every) Port is in Use?

Today I installed VS2010 SP1 Beta, and IIS 7 Express, as I currently have IIS5 on my local development machine and thought I'd try IIS Express out.
I have gone into the properties window for my Web Application, checked the 'Use IIS Express' checkbox, created the Virtual Directory when it has prompted me, but then get the message "Unable to launch the IIS Express Web Server. Port x is in use".
I have tried changing the port number from the default value that was in there, to numerous other port numbers, but whatever value is there, I am always getting this message, and am therefore unable to use the IIS Express Web Server.
Does anyone know what the problem might be, and how to get around it?
If you are using ESET NOD32 Anti Virus, you need to change the setting of "Web access protection" => HTTP, HTTPS => Web browsers => red cross the check box of your devnev.exe (This is three state checkboxs, click the check box until red cross appeared)
I have just installed VS 2010 SP1, using the above setting to tell NOD32 to leave 'IIS Express' alone.
Reference: http://weblogs.asp.net/anasghanem/archive/2009/02/01/nod32-antivirus-is-blocking-visual-studio-built-in-development-server.aspx
What version OS are you using?
Are you able to start IIS Express from command line? Could you try the following and post the error message you are seeing.
Remove IISExpress directory located under 'My documents' folder
Go to IIS Express installation folder '%programfiles%\IIS Express' (on 64-bit machine '%programfiles(x86)\IIS Express') and try to start iisexpress.exe from command line (without passing any arguments)
I had a similar problem. It seems that if IIS Express is already running a particular site and then you try to run a project that uses that site through Visual Studio it isn't able to attach the debugger. The solution was to close any running instances of IIS Express and WebMatrix and then try running the site through Visual Studio (F5).
I recommend installing WebMatrix as it's the simplest way of managing the sites and port numbers that you are using.
I have the same problem in the visual studio 2012.
I am creating a sharepoint app for the SharePoint 2013 and it happened after some days means it was working before then I got the error:
" Unable to Launch IIS web Server " "port 62308 in use.
To fix this I just went to the settings of the web project by right clicking on the project node in in right panel under the project solution tab. Change the port number and configure the virtual directory and it worked for me.
Hope it work for anyone else in case he/she has any problem.
1- Close Visual Studio.
2- Delete IIS Express folder in Documents or edit applicationhost.config:
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
3- Delete solution file.
4- Start Visual Studio and use open website.
5- Choose your website folder.
If any body still facing the same issue ... even after trying all the above steps
try the following simple steps...
1) close all other applications
2) Download TcpView application from
http://technet.microsoft.com/en-gb/sysinternals/bb897437.aspx
3) run the application, check the localport column and see who is using that specific port
and end that task
That will solve your problem ... :)
go to solution explorer, right click on the present Application then go to properties, now click on web scroll the mouse and change the port no. from project localhost:1257
NOW RUN IT...

VS2010: "Unable to start debugging"

My VS2010 debugger has stopped functioning suddenly today on my Dell M4500. I had reinstalled VS2008 SP1 last week, but the 2010 debugger ran fine since then, so I'm not sure its the culprit.
I can launch a project once just fine, & afterwards I get a message that reads "Unable to start debugging," without any error # or explanation of why. Doing IISRESET doesn't help, I get the same message until I close VS with the entire solution and reload it. Here are some things I've tried:
Verified I have the latest project files
Repair option for VS2010
Complete uninstall/reinstall VS2010
Replaced Web.config with known good copy
Added localhost to the list of trusted sites in IE
Performed \aspnet_regiis -i in the 2.0 & 4.0 directories
Through IIS Services Mgr -> Default Website:
verified Enable HTTP Keep-alives checked
placed check in Integrated Windows authentication
Ensured Debug on "Any CPU" is selected
Tried building to Platform targets "Any CPU," "x86" & "x64"
Added DisableLoopbackCheck registry key entry in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Tested under both IIS & VS Development web server
Does anybody have any suggestions I can also try? Any help is very greatly appreciated!
Just a side note. I got a similar error in VS2013 trying to attach to chrome the error was:
Unable to attach the application 'chrome.exe' using XXX The 32 bit
version of the visual studio remote debugging monitor (msvsmon.exe)
cannot be used to debug 64 bit processes or 64-bit dumps. Please use
the 64-bit version instead
I had to untick "Silverlight" in the web project Web section:
I received this same message, preventing my web project from running and opening in a browser. Turns out another developer had made a change in the project properties to "Use Custom Web Server" which pointed to an external URL instead of to the web server on my machine.
Try this:
Right-click your project in Solution Explorer - click Properties - click Web tab - under Servers click "Use Visual Studio Development Server". For reference the usual port value here is "Auto-assign Port". Best of luck.
Here's why I got this error.
In Debug properties, verify that Start external program is not empty.
VS 2010 will warn you about it being empty, but will let you save it
I was trying to switch it from IE to Chrome, lost track of changes I was making, and spent an hour trying to figure out where this error was coming from.
I had the same issue but it worked when I switch Build => Platform target from x64 to x86.
Kindly turned off Debug Edit and Continue option
Turn on vs2010, run debug.
turn off debug, shut down all lunched webServers (i had few of them for different services)
Turn off VS2010
Turn on VS2010.
After that everything works perfect.

Unable to use IIS7 with Visual Studio 2010, MVC2.0 and NET4

Here is my environment
Windows7, Visual Studio 2010, MVC2.0 and NET4
My default web site is configured to use ASP.NET v4.0 application pool.
Here is an easy way to reproduce my problem
Create a new MVC2 application
Open the properties Window
Go to the Web tab
Check "Use IIS Local Web Server"
Click on "Create Virtual Directory" button
I get this error message
To access local IIS Web Sites, you must install the following IIS components:
In addition, you must run visual Studio in the context of an Administrator account
For more information, press F1
Notice the blank line after "...the following IIS components:"
I am running VS2010 as administrator
Pressing F1 does not bring any help
I checked my Windows eventlog files and found that my metabase was corrupted
(I thought we get rid of this in IIS7 but it looks like it is still here...)
I used this Microsoft article to restore it from an old version and now everything is working
Hope this can help somebody else
Have you tried running VS as administrator?
Right click your VS shortcut and select "Run as Administrator"
I had the same error message, in my case with VS2008, Windows 7 + IIS7, when trying to add an existing web site to a solution. I think this is one of those error messages where what it states can be a big red herring, i.e. it doesn't necessarily have anything to do with running as an administrator or not having components installed.
In my case, the web site had an HTTP binding in which the hostname was set to "localhost". Once I cleared that, it worked fine. Don't ask me why I put "localhost" in there, it just seemed to make sense at the time.
My internet hunting also turned up this brief entry, which did not work for me.

Error message "unable to open web site" with VS 2008 on Vista

I am trying to open a project in VS 2008 and my domain account it in the administrator group. I get this message:
"Unable to open the Web site
'http://locahost'. To access Web
sites on thie local IIS Web server,
you must run Visual Studio under an
Administrator account in order to have
access to the IIS metabase.
Alternatively, instll FrontPage Server
Extensions (FPSE) and then grant FPSE
access to users who will run Visual
Studio"
Any body know what I need to do to fix this problem. I have tried modifying the shortcut to run as administrator but shouldn't have to do that if I am an admin on my machine.
I uninstalled IIS and then reinstalled using only the bear minimums and it worked.
What worked for me:
- Windows 7 IIS Manager
- Delete other websites in the list under 'Sites'
- Right click the site
- Edit Bindings
- The 'host name' property was empty. Once I typed the name of the website there, I was able to load my site through Visual Studio 2008.
Open Control Panel-> Programs and Features->Turn Windows features on or off. Under the list of features open Internet Information Services tree and then open Web Management Tools and then select IIS 6 Management Compatibility checkbox. Click OK button and install the selected feature of IIS.
link: http://geekswithblogs.net/technetbytes/archive/2011/10/11/147255.aspx
Right click over the shortcut, and in Properties in the Compatibility tab, select Run As Administrator.
Also confirm IIS is installed. It is not installed by default on Vista. You have to go and Add/Remove Windows Components.
See here.
You might not have IIS setup properly on the local machine, I would verify your IIS configuration before continuing. You can always create a website or webapplication that runs through cassini instead and provide a folder path vs a IIS path.
P.S. Even if you are a machine administrator, with vista if the access restrictions are on you must still always specify that you wish to run the application under an administrator context.

Resources