9

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?

Martin Braun
  • 10,906
  • 9
  • 64
  • 105
royu
  • 377
  • 2
  • 5
  • 15
  • I would love to see an answer to this, as it is happening to me as well. It only begin when I updated from IE 7 to IE 8. It doesn't occur every time that I debug my web application, but I'd guess somewhere around half of the time. Very, very annoying! – Jagd Aug 30 '11 at 16:14
  • Strange. I just received the update to IE11 and am now into this too. – Marcel Nov 26 '13 at 10:10
  • Well, a simple reboot of the machine solved it for me now. – Marcel Nov 26 '13 at 10:18

15 Answers15

5

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.

Andras Zoltan
  • 41,961
  • 13
  • 104
  • 160
  • @Andras Zoltan :) Already done that. It doesn't work/help either. The first time I did that I had to quit VS2010 and do an iisreset (because some dll's were locked - I am working on XP with IIS installed), after that I deleted all the folders in the temporary folder. When I started VS2010 again and run the project, I still encountered the same problem. As I said before, I am really stuck and pulling hair out of my head :( ... – royu Jun 10 '11 at 07:57
  • @royu - can you attach to w3wp? Are you running x64 and if so, have you enabled 32 bit processes? If so you might need to disable that? I must admit I'm getting to the end of my limit now too! – Andras Zoltan Jun 10 '11 at 08:01
  • @Andras Zoltan I run on x86. I will try to attach to w3wp. I appreciate your help a lot!!! – royu Jun 10 '11 at 08:15
  • @Andras Zoltan tried attaching yesterday and again a few minutes ago. It attaches to the process but I have no symbols, when I set a breakpoint it give a warning (The breakpoint will not currently be hit. No symbols have been loaded for this document.). – royu Jun 10 '11 at 09:10
  • @royu that means that Asp.Net is not building in debug. Please can you create **a brand new web application**, build and run it. When you get the message about debugging not being enabled, get it to enable it; then see what happens. – Andras Zoltan Jun 10 '11 at 09:17
  • Using mmc and open iis, going to the default.aspx - use rightmouse and click browse, everthing works fine ... :( – royu Jun 10 '11 at 09:32
  • @Royu - Yes the problem is not Asp.Net; it's debugging - so it'll always run. Have you tried a completely new project as I suggested and running it with F5? – Andras Zoltan Jun 10 '11 at 09:37
  • 1
    I took a backup and those sources are working just fine. I think that some files are corrupted :( I will go on from here, some code lost, so be it. So this isseus can be seen as *closed*. Thank you very much Andras! – royu Jun 10 '11 at 11:07
  • @royu - excellent news! Be sure to mark the answer as accepted if you're happy with the outcome; so the rest of the community knows this question is done :) – Andras Zoltan Jun 10 '11 at 11:19
  • Cheered too soon. I have tried the sources in VS2010 in a VPC. That didn't work, I then got a backup on the VPC and that worked. So, I got the bakcup to work on the PC, but the same problem remains, grrr. But now my options are gone. Something is clearly not going well when the website should be started in the Web browser. On that point it is stuck. After all building and compiling works just fine ... – royu Jun 10 '11 at 12:11
  • Clearing the temp files as usual solved this particular and other weirdness – trevorgk Oct 09 '13 at 03:41
4

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

Community
  • 1
  • 1
  • No idea why this works, but had exactly the same issue running MVC app in VS2015. Error Message suggests repairing/reinstalling VS. Changing default browser then changed back worked for me - much easier solution thanks! –  Apr 07 '16 at 09:09
1

the solutions for me is to test with 127.0.0.1 in place of localhost. and all goes well for.

so the problem come from the host resolution name, to solve it please proceed like :

  • open cmd and then tape : %systemroot%\System32\drivers\etc\
  • open hosts file with notepad and the look for localhost ligne(you'll find 0.0.0.0 befor it )
  • change the 0.0.0.0 with 127.0.0.1 at all lignes with localhost .
Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
1

I solved in this way:

  1. Right click on a aspx page
  2. Browse with set internal browser as default
  3. Remove the previous default browser
  4. Add %programfiles(x86)%\internet Explorer\iexplore.exe
  5. Set this choice as default
demongolem
  • 9,474
  • 36
  • 90
  • 105
1

Had same problem, answer for me was to remove Avast Free AV. Everything worked for a year with avast free up until a week or so ago, uninstalling it fixed the problem.

Ken Graci
  • 11
  • 1
1

I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".

  1. Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
  2. Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
  3. Debug away! Your app should come up in your browser now and debug as normal.
Armin Sadeghi
  • 766
  • 12
  • 19
0

For me I just did a Build /ReBuild on the project level and it started working!!!

Nikhil
  • 16,194
  • 20
  • 64
  • 81
0

Please set your page name e.g Default.aspx revert to parent in IIS configuration

0

I'll share my experience with this same problem. This is not a solution, but someone may be able to figure out the problem from my particular experience.

I've been having this same problem for a few weeks now. (I don't know what changed on my system.) I do not run as local admin, because we are not allowed to have admin privileges on our PCs where I work.

Until today, I could expect F5 (Start Debugging) to start up a new local VS web server, open an IE window, and then issue an "unable to start program http://localhost:nnnn/Login.aspx" and "access is denied" error pop-up. If I closed the IE window, waited a few seconds, and then clicked F5 again, it usually started up my web app in debug mode just fine from that point on.

But today, that all changed. I did not change any configuration on my web app, which has been running fine, but I did add a couple of more classes to one of my subprojects. At this point, I could never get past the "unable to start program" message. I could run my app without debugging, but that was rather pointless. I even tried attaching to a running (non-debug) IE process, but that did not work.

Finally, I modified some of the properties in the WebAppName >Web >Servers screen. Specifically, I enabled "Specific port" for a specific HTTP port (which VS had been using all along), and I disabled "NTLM Authentication". I also enabled "ASP.NET" in the Debuggers section. Some of these I first clicked, then unclicked, then clicked again, saving in between each click.

This time, running with debug (F5) worked.

After running several times, I still usually get a "unable to start" error the first time after a recompile, but I can still usually get a debuggable running app to start after the second or third try. At least I'm back to where I was yesterday.

I suspect it has do with VS reloading its execution profile, and also probably something to do with permissions (since I cannot run as admin).

David R Tribble
  • 11,918
  • 5
  • 42
  • 52
0

I'm using VS2012 with an ASP.net app that was written using VS2003... I've tried everything to get the IE page to open automatically when I select F5, or even Ctrl+F5... Haven't been able to get anything to work... However, I have stumbled upon a very poor work-around. When I select debug and I get the 'Unable to start program...' msgbox... I noticed that on the icon-tray I get a msg saying local-host has started

You'll notice a picture that the msgbox is pointing to: Well, if you right click it, you get three options:

When you select the first: 'Open in Web Browser', it will open IE with the page your working with...

Like I said, it's a very poor work-around... but it works. This isn't an issue when I select debug using 'Chrome' or the page-inspector... But they have their own issues.

Volker E.
  • 5,911
  • 11
  • 47
  • 64
0

Try to turn on Bypass proxy for local addresses. First you can go to your browser settings-> Change proxy Settings-> Connection-> Lan Setting and just check bypass proxy for local addresses. If this solution don't work then also copy the following code check your web.config file for settings to bypass firewall:

<system.net> 
 <defaultProxy> 
  <proxy usesystemdefault="true" proxyaddress="http://proxy:port" bypassonlocal="false" /> 
 </defaultProxy> 
</system.net>
TResponse
  • 3,940
  • 7
  • 43
  • 63
Mukul Aggarwal
  • 1,515
  • 20
  • 16
0

I easily resolved this problem by enabling script debugging in the browser.

ObiwanBill
  • 91
  • 1
  • 1
0

When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.

Since then, I have made a .bat file with this code: taskkill /F /IM iexplore.exe /T

so now I just run the .bat when I get that error. (alternatively you could run that code from the cmd)

James Butler
  • 96
  • 1
  • 2
0

I just ran into this problem in Visual Studio 2013. I had to enable Anonymous Authentication.

Click on the project node in solution explorer. Hit F4 to show the properties window. Change the Anonymous Authentication option to Enabled.

Brian
  • 334
  • 4
  • 16
0

I had the same problem. When I debug my code it says:

Unable to start program 'C:\homework.exe'. this system cannot find the file specified."

I'm using Microsoft Visual C++ 2010 Express but when I made a new project by the following steps:

Open C++:

  1. Press new project
  2. Press win32
  3. Press win32 Console Application
  4. Rename it
  5. Click next
    make sure: that the application type is console application
    additional options: empty project*
  6. Press Ctrl+Shift+A
  7. In Visual C++/Code section press C++ File (.cpp)
  8. rename it and press add

It works fine with for me now.

jonsca
  • 10,218
  • 26
  • 54
  • 62
nOOb
  • 1