Paul Knopf
Paul Knopf

Reputation: 9776

Visual Studio not debugging

When I press F5, my web application starts up and runs, but the Visual Studio debugger is not attached to the process. The play button is always enabled.

I checked the configuration manager and all the libraries and web applications are debug|any-cpu.

Upvotes: 4

Views: 18207

Answers (10)

JamieB
JamieB

Reputation: 703

I just had this exact same problem. Deleting bin and rebooting didn't resolve it. What did work, though, was right clicking on the project within Visual Studio, selecting Unload Project, then selecting Reload Project. Had to do the same thing for one of the required libraries that was just saying "skipped" instead of building. insert-shrug-emoji-here. Disclaimer: this was on VS 2008.

Upvotes: 0

Rachel
Rachel

Reputation: 103397

Check if all debugging symbols are set on.

Also see in which folder you have your DLL, lib, or bin files.

Upvotes: 0

manji
manji

Reputation: 47968

Check for this option:

*Property Pages* (right click project) → *Start Options* → *Debuggers* → *ASP.NET*

It must be checked to enable the debugger on your web pages.

Upvotes: 0

Doron Yaacoby
Doron Yaacoby

Reputation: 9740

Have you set

<compilation debug="true"/>

In your web.config file?

Upvotes: 3

Davinder Singh
Davinder Singh

Reputation: 1

Click on Tools -> Options-> Debugging -> General

Then uncheck the box "Require source file to exactly math the original version".

Upvotes: 0

Richard Pursehouse
Richard Pursehouse

Reputation: 1129

  • In web.config, check you have: <compilation debug="true" />

  • If you have web.config transforms, ensure your environment you are building for in the drop down next to the run button has: <compilation debug="true" /> (i.e. not <compilation xdt:Transform="RemoveAttributes(debug)" />)

  • On the property pages (right click on project -> properties), on the build tab from the left, tick "define debug constant", click the advanced button at the bottom and set output debug info to full. Then on the web tab on the left, at the bottom check that Debuggers ASP .NET is checked.

Upvotes: 0

pasx
pasx

Reputation: 2975

I get this very often with a standard app - not a web application.

I have noticed that this happens when I change the properties of the startup project.

Anyway my solution is:

  • Open the bin folder

  • Delete the exe, config and pdb for the startup project (my solution has scores of projects so I don't want to delete more than is needed there).

  • build the startup project

  • hit F5

Very frustrating indeed...

Upvotes: 0

GlennG
GlennG

Reputation: 3000

Oh how I hate this answer, but it has just worked for me...

Symptoms: it works fine for weeks, then simply refuses to debug.

Solution: close Visual Studio, delete the contents of the Bin directory, reboot.

Irritatingly it required a full reboot to get it to start debugging; restarting Visual Studio + iisreset wasn't enough.

More info: I sometimes find that IE's cache is the culprit (strange but true). Therefore close all instances of IE, start IE, clear the cache, close IE, then try debugging with Visual Studio again.

Upvotes: 3

RepDetec
RepDetec

Reputation: 751

Try cleaning your solution. You might also blow away everything in the bin directory that your application is compiling to. Then rebuild the whole solution.

Upvotes: 0

Buggieboy
Buggieboy

Reputation: 4696

You can also run your web application outside of Visual Studio, then select Debug->"Attach to process". In the process list, choose the ASP.NET working process, "asp_wp.exe".

Upvotes: 3

Related Questions