Friday, May 26, 2006

Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged.

I have planned to share my experience on the various .NET errors which I have faced till now and the solution for the same. This is the first post in this series.

Error: Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged.

Cause: Either debug is not enabled in your web.config (OR) For some reasons IIS is not considering your web application as a virtual directory. Instead it is considering it to be a normal folder.

Solution 1:

Step 1: Open the web.config
Step 2: If debug is set to "false" change it to "True".

For ex:
In my web.config I have a line like this <compilation defaultLanguage="c#" debug="false"/>
I would change it to <compilation defaultLanguage="c#" debug="true"/>

If at all this doesn't work. Try out the next solution.

Solution 2:

Step 1: Start >> Run >> inetmgr
Step 2: Navigate to the virtual directory of the project which is throwing this error.
Step 3: Right click on the virtual directory and choose "Properties"
Step 4: Next to the application name there would be a button named "Create". Click on it. [After that, the button should read as "Remove"]

If at also doesn't work, try the next solution.

Solution 3:

If you are running Visual Studio 2003 (or ASP.NET v1.1) you should setup IIS to use ASP.NET v1.1 and not ASP.NET v2.0

May be you have installed .NET framework 1.1 as well as 2.0 in your box and trying to run an application via VS.NET 2003. If so, then do the following:

Step 1: Start >> Run >> inetmgr
Step 2: Navigate to the virtual directory of the project which is throwing this error.
Step 3: Right click on the virtual directory and choose "Properties"
Step 4: Choose the tab ASP.NET
Step 5: The first dropdown would read "ASP.NET Version", choose 1.1.4322

That's it. Hope this helps somebody sometime somewhere in the world :)

21 comments:

Anonymous said...

Great!!!
After 2 days of searching, finally found out that this was the problem!!!

Anonymous said...

Thanks, that helped. God bless you.

Anonymous said...

Thank uuuu... u helped me in finding out this, without wasting much of my time.

Rombout said...

It did help. Thanks a lot!

Anonymous said...

Nope, still didn't fix it!!!

LoveToSpod said...

OK, I needed to add the ASPNET account into the permissions for the wwwroot on the server. I found the following link VERY helpful - like shows screenshots... - like helpful...

http://www.gotdotnet.com/team/csharp/learn/whitepapers/_Toc49569439

I still have a separate issue with RPC Server not available when trying to debug with a remote machine, means for the time being I'll have to use debug on the server :¬[

Two wasted days fabricating excuses as to why I haven't done much. I Can't believe how @#!%$ fiddly it is to make some Micros*ft products work. A complete waste of time. Why doesn't software come with intelligable diagnosis to pin-point exact causes for such issues.

Rant Rant Rant, best of luck, you'll need it.

LoveToSpod said...

For some reason the url became truncated - see if this works

http://www.gotdotnet.com/team/csharp/learn/whitepapers/_Toc49569439

lovetospod said...

OK, this sux! :)

Try concatenating these two strings:

http://www.gotdotnet.com/team/csharp/learn/
whitepapers/_Toc49569439

lovetospod said...

OK, this sux! :)

You'll need to concatenate these two strings to get the complete url

http://www.gotdotnet.com/team/csharp/learn/
whitepapers/_Toc49569439

Soumya said...

Thanks, Solution 3 worked for me. I have both VS 2003 and 2005, on my machine and at some point I said to configure localhost to 2005. Now with solution 3 I fixed problem and able to run both.

Anonymous said...

Yes, I am one in the world for which this solution actually worked!!! Thank you so much!

Hmm.. (GRRR!, rather), why does this not work with .NET 2?

-dan

Anonymous said...

Duh! (me again) I get the feeling that VS 2005 is required for .NET 2

:-)

Anonymous said...

Thanks!! your post did sure help me in the world... the 3rd option worked for me ...
Thanks a ton :)

Anonymous said...

Nothing seems to work form me. After creating a new project in vs.2003 and run it, I got the same error (there is no virtual directory in IIS at this point/time)

Anonymous said...

I had the same error. But mine was because the web.config file did not have security permission for the aspnet account. Just wanted to mention this so that it can help someone.

Anonymous said...

Tried everything here without success...
Then I decided to go with the famous aspnet_regiis -i and that did the trick.

HTH

sravani said...

Thanx alot....the second solution worked out for me.u r doing a gr8 job.

rite now its working but ..when i start debugging it showing an error like "unable to start debugging ..debugging failed coz integrated windows authentication is not enabled."
why i am getting this?How to check it out?
plz mail me at
shalni_raj7@yahoo.com

Anonymous said...

thanks a lot. I've been having this problem for 2 days now. I just fixed my problem.

Sam from Germany

Anonymous said...

Hey...the solution #3 works for me!!! Thanks alot! Hurray...!

Sunshine said...

could be that your iis server certificate is missing, create a self assigned server certificate.
edit bindings: point to the newly created cert.

Sarvesh Gulia said...

Very good post and I found very helpful. There could be some more reason for this issue. I got solution from both yours and below link. Thanks.
http://blogershub.com/Archive/2014/2/Unable-to-start-debugging-on-the-web-server-The-project-is-not-configured-to-be-debugged