Fabio Milheiro
Fabio Milheiro

Reputation: 8474

"The breakpoint will not currently be hit" keeps showing on a partial view

In a specific partial view, I consistently get a message in the breakpoints I set:

"The breakpoint will not currently be hit. No symbols have been loaded for this document."

Is there any reason for this to happen? What may I have done?

I restarted Visual Studio and I even restarted my computer, but it didn't work.

What do I have to do to debug this page?

Thanks!

Edit

I edit the partial view file with which I am having problems, but the changes do NOT take effect. So, somehow, that bastard compiler is getting the file from somewhere else. Where?!

Upvotes: 9

Views: 10586

Answers (4)

Big Al
Big Al

Reputation: 111

I had the same situation after modifying a view that used to debug ok. I reverted my changes and debugging resumed working. I found I had a syntax error on a line. There was no clue it was wrong - there was no red underlining and the project compiled fine.

If you have the problem in your view, I suggest commenting most of the code to a minimal skeleton. If debug works again, uncomment some of your lines back in until you find the problem code. Good luck with that.

Upvotes: 11

Amer Bashoeb
Amer Bashoeb

Reputation: 11

The way I resolved it is by going to the properties(F4) of the file and set the value of Build Action to Compile.

Upvotes: 1

Jean-Bernard Jansen
Jean-Bernard Jansen

Reputation: 7870

There are several possible reasons for that:

  • The version of the source file is not the one you compiled. Try to recompile.
  • The DLL containing the code is not loaded in the program at runtime. Use the program in a way that the DLL will be needed if you have dynamic loading of DLL.
  • You are visualizing a source file which is not in the right directory (another copy of the solution somewhere else on the hard disk). Open the right source file.
  • You didn't compile the program in debug mode. Recompile it in debug mode.
  • You didn't launch the program in debug mode. Launch it in debug mode.

Upvotes: 9

J Benjamin
J Benjamin

Reputation: 4782

This is happening to me too...it's a real pain in the arse. The reason is because your PDB files are missing from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root[random][random]\assembly\dl3[random][guid]

I have about 30 DLL files that get built with my project, I have to go into each one of those stupid temp directories and copy the PDB file for each DLL from my VS build bin. I've posted questions on here about it too but haven't gotten any help. For a quick fix, you can try to copy your matching pdb files over but I'm telling you it's gonna get old real fast.

Someone else in my office has fixed the problem by using the "Publish" feature in Visual Studio and publishing their site straight into a web directory but I haven't had any time to mess with that yet. Someone else has told me that it's a x64 bug in Visual Studio but I find that hard to believe considering how crippling it is.

Upvotes: 2

Related Questions