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

10

18

As you can notice

enter image description here

Symbols are been correctly loaded.

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

enter image description here

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 :-/

Aquiculture answered 12/4, 2011 at 9:19 Comment(0)
E
7

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?

Examen answered 12/4, 2011 at 9:58 Comment(0)
B
9

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)
Brindabrindell answered 13/11, 2012 at 18:57 Comment(0)
E
7

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?

Examen answered 12/4, 2011 at 9:58 Comment(0)
P
3

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.

Pitts answered 18/11, 2012 at 20:49 Comment(3)
Did a bit more checking... it seems if Visual studio guesses the wrong runtime, you may not be able to debug. Here is the solution: blogs.msdn.com/b/greggm/archive/2010/06/08/…Pitts
Thanks @user1834226. You comment above is what it turned out to be the problem in my case. I was debugging the app in Release mode and my breakpoint in the library project was not hitting.Fabriane
Changing the target framework is a huge hassle and rarely an option.Recommendation
P
1

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".

Publicspirited answered 5/7, 2012 at 9:19 Comment(0)
C
1

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

Charpentier answered 11/12, 2013 at 21:3 Comment(0)
T
1

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.

Trilinear answered 9/9, 2016 at 1:55 Comment(0)
T
0

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.

enter image description here

Ticket answered 19/7, 2013 at 14:58 Comment(0)
P
0

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.

Peeples answered 10/1, 2014 at 14:14 Comment(0)
P
0

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.

Purse answered 28/2, 2014 at 15:55 Comment(0)
P
-1

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

Piercing answered 17/5, 2022 at 7:14 Comment(1)
this is a question from 2011 and as you can see there's already an answer marked correct, there is no point of answering it...Aquiculture

© 2022 - 2024 — McMap. All rights reserved.