开发者

"No symbols have been loaded for this document." But they have!

开发者 https://www.devze.com 2023-02-25 10:46 出处:网络
As you can notice Symbols are been correctly loaded. I just created a view GetCompanies.cshtml using the AddView shortlink

As you can notice

"No symbols have been loaded for this document." But they have!

Symbols are been correctly loaded.

I just created a view GetCompanies.cshtml using the AddView shortlink

"No symbols have been loaded for this document." But they have!

But, no matter what I do, I can't debug in the View.

What I did so 开发者_如何转开发far:

  • Close and Open Solution
  • Close and open Visual Studio
  • Shutdown all ASP.NET Development Server's
  • Deleted all Symbol Libraries .pdb
  • Clean Solution
  • Re-Build Solution

did not (yet) shutdown Windows 7 x64 :-/


Sometimes if you have a hard stop, Visual Studio temp cache will be screwed. Clear the cache by deleting these folders:

C:\Windows\Microsoft.NET\Framework\<.net version>\Temporary ASP.NET Files\(ApplicationName)
C:\Windows\Microsoft.NET\Framework64\<.net version>\Temporary ASP.NET Files\(ApplicationName)


I am finding the same behavior from time to time when debugging silverlight. My solution is to clean the browser's cache (on latest IE click on the wheel button, Developer tools), as it sometimes will cache the binary files and not load the new ones.

Perhaps is could be the same with your views?


Been messing with this problem for a couple hours trying everything above. I finally changed my Target Framework to .NET Framework4.5 and it all started magically working.


This is always weird. I just had this problem and solved it with a full rebuild of the entire solution.

There was also another strange symptom, though: a new unit test that I had written using NUnit, mocking with NSubstitute, wouldn't pass because NSubstitute wasn't returning what I wanted it to return. I lost a few minutes trying to figure out if I did something wrong programming NSubstitute, then when I tried to attach the debugger to the NUnit GUI I saw that warning.

That's when I decided to do a full rebuild of the solution, and that worked for me.

So I guess the lesson to be learned is "before smashing your head against the wall, try a full rebuild".


For me, I somehow switched my target build to Release instead of Debug


Remember that views are actually compiled when you request the page (by default).

This means when you set a breakpoint in a view:

  1. It shows the "No Symbols" error. This just means the view isn't compiled yet.
  2. It shows the breakpoint fine. This just means that it found SOME compiled version of the page. Like the LAST working version...

So basically its not meaningful information to look at what it says when you mouseover the breakpoint in a view (at least in this regard)

If you are trying to debug this page, then you have a problem. Look at what the debugger is outputting to your BROWSER instead and fix that first. I think we'll be surprised about how many people are going to facepalm at this.


I had this problem with SL5 project (VS2012). And to fix this, I was needed to set "Silverlight" option enabled in %MyProjectName%.Web project properties, under Web tab.

"No symbols have been loaded for this document." But they have!


In my case, the .PDB file was hosed (from which the symbols are loaded) in VS 2012, so performing a Clean and Build reconstructed the .PDB file and everything started workign again.


I was attempting to debug a deployed WCF windows services (compiled in Release mode) and had the exact same issue. Give this a shot...

  1. Save All. You may even want to try to clean the solution
  2. Rebuild all and install or deploy
  3. BEFORE starting the service (or exe) I copied the .pdb files over to the install folder
  4. Start the service (or exe) and attach the debugger to the process

Worked like a charm (finally) for me.


delete bin and obj directories run solution again. Note: Unless that cshtml loads at runtime the symbols are not loaded. On page load that breakpoint will be hit. So wait till control goes to that page

0

精彩评论

暂无评论...
验证码 换一张
取 消