Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start program 'http://localhost/Default.aspx'. VS2010

I cannot start my website from Visual Studio 2010 anymore.

For a few days I cannot start my project in a web browser using F5. When I open my web application directly by typing the same url 'http://localhost/Default.aspx' everthing works fine.

When I run the project (F5) a new webbrowser starts, but after a few seconds it is stuck and Visual Studio gives an error dialog:


Microsoft Visual Studio

Unable to start program 'http://localhost/Default.aspx'.

OK


When I run the project in release mode it gives an extra error:


Microsoft Visual Studio

The following module was built either with optimizations enabled or without debug information:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6552bec6\694bce32\assembly\dl3\8c9bd8d8\fb1d75cb_af26cc01\[name].Presentation.DLL

To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.

OK


I have already repaired, removed and reinstalled Visual Studio 2010, I've tried using different browsers (including Chrome and Firefox), used different aspnet_regiis.exe options, etc. etc.

Nothing helps, and yeah now I'm stuck pulling hair out of my head ...

Anyone any idea how to solve this?

like image 252
royu Avatar asked Jun 09 '11 14:06

royu


2 Answers

Does it work if you start it with [CTRL]+[F5] which runs without the debugger?

If so, then you have an issue with the debugger auto-attaching to the web server. I would check that debugging is enabled for your web project - a warning that usually crops up automatically from VS when it detects that a project is not built in Debug mode.

This is not as simple as switching the project configuration over to Release, because the DLL that the debugger is moaning about is one of the dynamically generated ones originated by Asp.Net itself.

Typically you should have, in your web.config:

<configuration>
  <system.web>
    <compilation debug="true" >
    </compilation
  <system.web>
<configuration>

(Along with any other stuff in <configuration> and <system.web> nodes).

There's also the possibility that Asp.Net debugging is not, for some reason, enabled.

Check out this msdn article on debugging asp.net applications in VS2010 for more information.

Note that if this is VS010 express, then you won't be able to debug - as confirmed by the aforementioned link; but since you way it used to work then I guess that's not your problem.

Update

Since that hasn't worked - you can try emptying the Temporary ASP.Net files folder. Easiest first is to do an iisreset. Then navigate to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and delete everything in it. I've had issues in the past where the Asp.Net binaries don't get refreshed and so when I'm debugging it moans that the files are out of date.

like image 124
Andras Zoltan Avatar answered Oct 25 '22 16:10

Andras Zoltan


Change the View Browser to another browser. Run the view in browser or debug, then change back to original browser should work after that.

like image 45
Terry Higginbotham Avatar answered Oct 25 '22 18:10

Terry Higginbotham