Visual Studio 2010 takes too long loading symbols, symbol file location cannot be removed - visual-studio-2010

Visual Studio takes a lot of extra time loading symbols for external dlls which I'd rather not load. I have fiddled with my symbol settings in VS2008 and these settings seem to be affecting VS2010
How do I stop it loading 3rd party symbols?
I've tried:
devenv /resetuserdata
Tools > Options > Debugging > Symbols (I can't remove or uncheck the pdb file location of: "Environment Variable: _NT_SYMBOL_PATH")
I've cleared the above location like so: set _NT_SYMBOL_PATH=
actually this made a huge difference (it was previously SRVc:\symbolshttp://msdl.microsoft.com/download/symbols)
I've deleted everything from: %localappdata%\Temp\Temporary ASP.NET Files\root\
The next thing would be a VS re-install, failing that an OS re-install, but if it saves me 14 seconds every time I press debug it would be worth it.

Try Debug -> Delete All Breakpoints

Things to try
Tools > Options Debugging > General
Disable source server support
Enable just my code(just tested and greatly improved load times for me) -when to disable
Disable .NET framework source stepping (automatically disables just my code if selected)
Tools > Options>Debugging > Symbols
Only Specified Modules
Or All modules unless excluded and exclude those 3rd party
I was able to remove all checks under .pdb locations, but I had d:\refsrc\symbols as an added location

I had this trouble too. I did not think that I had set _NT_SYMBOL_PATH but somehow it was set to the path I use when using WinDbg. I figured this out by running ProcMon from the SysInternals Suite and filtered out everything except DevEnv.exe and saw what files it was trying to access when debugging my application.
I deleted the _NT_SYMBOL_PATH environmental, restarted VS and everything runs like it should.
I offer this not so much for the answer which was supplied in the initial question but as guidance on how to figure out what was wrong.

For me, I had previously turned on Debugging -> Symbols -> All modules and forgot to turn it off when I was done with a particular project. Turning off this setting greatly improved my load times.

I had this trouble too. And I fix it easily. Just do: Debug->Options and Settings->Symbols. In Symbols I checked Only Specified Modules. Everything works fine again. Hope this helps.

Related

Visual Studio 2015 debugging: Symbols cannot be loaded until I restart my computer

Recently, whenever I change something in my code, rebuild, and attempt to debug, I get the error "This breakpoint will not currently be hit, No symbols have been loaded for this document."
But then as soon as I restart my computer, everything is fine and I can debug properly. Why is this happening? It's really frustrating having to restart my desktop every time I try to debug my code. I've looked all over stack overflow and MSDN and can't find any solution to my particular problem. Any help is appreciated
"This breakpoint will not currently be hit, No symbols have been loaded
for this document."
(As for this error message, it's common error which has different causes. I can't give the most direct correct answer for this issue, I can only give you some tips for trouble-shooting. In order to avoid losing contact in the round-trip comments, I post those content as answer instead of comments.)
Since VS2015 have been released for long time, I would think this issue is a particular one, not found similar issues online.
First of all, please create a new simple project to check if this issue occurs in new project when debugging.
If it persists in new project, I think this issue has something to do outside environment like VS settings, VS config files or Debug options.
You can try:
1.Go Tools=>Import and Export Settings=>Reset all settings =>No,just reset settings=>Finish
2.Repair VS IDE since it seems to work well in the past, and just got the issue recently, so maybe something is broken for your IDE(In Control Panel find VS2015, right-click=>change=>repair). Also, make sure you have the latest VS2015 Update3 instead of earlier versions.
And if it works well in new project, then maybe the issue is about the whole project or solution itself. You can try:
1.Navigate to solution folder, close all vs instance, delete the .vs, bin and obj folders and restart VS to check if it helps.
2.Make sure you've loaded the required symbols, check the content in your Modules window during debugging, there's possibility you don't load necessary symbols successfully.
3.Check the output folder after your rebuild, check in folder like bin\debug folder if you have both the .exe and .pdb files. And make sure the .exe and .pdb files are up-to-date after your rebuild by checking their Date Modified.
Hope it helps and more info about the project type, dependencies would be better:)

Visual Studio 2010 remote debugging: Debugging symbols are not loaded for this document

This is a weird problem, which luckily (?) also happens on other machines.
I've never had problems with debugging, and now I have: it shows an exclamation mark at my breakpoints which says :'The debugging symbols are not loaded for this document'.
The difference with other projects is that I run this web application in IIS:
I've created a new website in IIS 7.5 (win7), listening on port 80 to
local.comparer.nl
I've added the url local.comparer.nl to my hosts
file, redirecting it to 127.0.0.1
I've edited the start page of the
project (asp.net 3.5) to local.comparer.nl in 'use local IIS
webserver'
When I start the site, it first says 'unable to start remote debugging'. I don't know why it looks for remote debugging, but when I started the remote debugging monitor, it still didn't work.
When I unloaded the debugging monitor, it didn't complain about the remote debugging anymore, but the exclamation mark still was there.
Solutions which -sometimes- help at my colleagues pc's:
Delete everything from the \bin directory and rebuild
Rebuild again (n number of times)
Choose 'clean solution'
Any idea?
Are you building full debugging symbols? If not then the debugger has no information to relate the source code to the in memory activity under the debugger. This is set in the project properties per configuration.
Also ensure the symbols are in the bin folder.
You can validate that VS is loading the right symbols with the Debug | Modules window.
I had this issue bothering me for quite long. Finally, what resolved my problem is :-
1) Make Internet Explorer the default browser
2) Clean the solution
3) Build the solution
In my case I renamed an asp.net page and disconnected the code behind. Strange it still ran but did not run the code behind and therefore did not hit breakpoints in it.
You have to in Visual Studio 2010
Select "Build" Meanu > Clean [Project/Solution Name]
Rebuild [Project/Solution]
Try debug again... Good luck

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

As you can notice
Symbols are been correctly loaded.
I just created a view GetCompanies.cshtml using the AddView shortlink
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:
It shows the "No Symbols" error. This just means the view isn't
compiled yet.
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.
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...
Save All. You may even want to try to clean the solution
Rebuild all and install or deploy
BEFORE starting the service (or exe) I copied the .pdb files over to the install folder
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

Visual Studio keeps running the old build

I have a simple Silverlight program that displays a bunch of images. I modified it do display more images, but it when I hit "run without debugging" is keeps running the old build with fewer images. When I copy the code into a new project and run it, it works fine for the first time, but then each subsequent change is not displayed. What could be the problem? I'm using Visual Web Developer 2008 Express.
Always check "Configuration Manager" option on "Build" menu in Microsoft Visual Web Developer. The checkBox "build" has to be checked, otherwise it won't build.
Happened to me, I hope this helps others.
I just had this happen to me in VS 2013 for Web. Had to change the Project URL in:
"Project properties"
 "Web" tab
  "Servers"
To a different localhost number and recreate Virtual directory.
Before my Project URL was:
http://localhost:55487/
I changed it to:
http://localhost:55488/
Then clicked "Create Virtual Directory".
Would like to know why this happened in the first place.
I found that I had to close all open instances of Visual Studio before I got it working again
This happens because your cache memory is full. just go to you bin and obj folder and delete all the temporary files. Now it will run properly.
Maybe it's a caching issue (webbrowser / proxy).
To fool the browser try to embed the xap file with an additional parameter that changes every time you open the plugin:
<param name="source" value="ClientBin/BubuApp.xap?<%=Guid.NewGuid().ToString() %>"/>
If this don't help, try to clean the project (delete obj / bin folders & xap file).
I was also suffering from this issue and none of the suggestions worked. I was building a Office.js add-in and debugging was with IIS Express.
What fixed the issue for me was deleting files in
C:\Users\<user>\AppData\Local\Temp\Temporary ASP.NET
Actually, I went ahead and and deleted the entire C:\Users\<user>\AppData\Local\Temp folder out of spite :)
I also had this issue and while some of the fixes above helped temporarily, the one that worked for me was to remove the history and caching in Internet Options.
Go into Internet Option (also available in VS via Tools > options > Environment > Web Browser > Internet Explorer Options).
On the General tab click Settings in the Browsing History section.
On the Temporary Internet Files page select Every time I start
Internet Explorer
On the History tab set the Days to keep history to 0
On the Caches and Database tab make sure Allow website caches and
databases is NOT ticked.
I'm not sure if all of the above are required, but I've made a number of changes to files and so far they have been reflected straight away in the dynamic versions without any noticeable performance problems.
I've also since realised if I set 'Every time I visit the webpage' instead of 'Every time I start Internet Explorer' I don't have to stop and restart the project to see the changes. Which is how it should be!
I used to suffer this. All of this used to be (for me) a folder's contents issue.
Maybe you can check this:
Delete %windir%\microsoft.net\framework\v4.0xxx\Temporary
IIS Express: even if you change the output file for compiled results, you will see in applicationhost.config that many times IISExpress is really "looking" to the default bin folder of your project.
It is even possible that you have different configurations for Debug or Release, so maybe IIS is looking BIN with Release code, and you are now compiling in Debug to another folder, do you understand me?
Happened to me too. Well i dont know the exact reason for this behavior. But when i close the visual C express 10 and then open again and build it builds the new saved file. I guess it still hangs on to the old file when there is an error in some debug mode or something.
Stop all incntance of VS.
Delete all /bin, not just /bin/Debug. All /bin
Remove user option .suo file in solution dir. It will create on self.
Remove all restore windows point
Stop IIS.
6 Start IIS after 1 minutes.
Rebuild solution, Buid projects
It happing on me too. Very nasty. You may restart your computer.
Check for global asembly dll.
Just delete folder 'Release' in project with old code build.
I had the same problem and none of the answers were working for me. It turns out that building the ASP.Net project did not build the Silverlight project, so running without debugging didn't update the Silverlight.
Fix: Right click the Asp.Net project. Build Dependencies > Project Dependencies. Check the Silverlight project. Now building should work.
If this is a web application, change the Project URL with a new port number.
Example :
Change from http://localhost:3688/
To http://localhost:36881/
To do this:
Navigate to Project properties -> Web
Change the URL
Hit "Create Virtual Directory"
Finally, Build and RUN
I had this issue in a web site.
The site referenced 1 of the projects in the solution, and changes to it would not reflect in the debug.
Issue was a third project was referencing an outdated dll of the same same referenced project.
I removed the project and all references in other projects and readded and re-referenced everything and it worked fine.
Check you haven't got two versions of whichever file you're updating (one for one group of users, one for a different group of users).
In my case(VS 2015) it was because of the missing dll in the .exe directory... I made a "clean solution", then additionally deleted all bin and obj folders' contents. Reason to do so was VS keeping to load old dll build. Solution was to select folder of the running debug config, i.e. everytime I rebuild project destination location with dll and a reference to it stays with warning mark for some time until intellitrace does its job. After doing the setup mentioned above, I still have to do a manual rebuild on a project that generates a dll into specified dir. Pressing F5 does nothing, I don't have time to find out why... Main thing is its working for me
I had this recently too and I didn't see the answer here. I was changing an MMI to get rid of redundant buttons, and they didn't go away.
Really old legacy code. To make it keep user settings - like language - someone had made it keep the Settings. I was not allowed to change this, they want it like that.
To get rid of the old settings and allow new ones:
open regedit
navigate to HKEY_CURRENT_USER - Software - MyProject - SubProject
here you see Recent File List and Settings.
Delete Settings completely - don't worry, it will make a new one.
Please check is there any old .tlb file present in someother folder. In my case i was using the .tlb file generated using .NET dll and then created the .tlb file using RegAsm. I tried to use the .tlb file in vb6 code, it still refers old code only. After a long search i found same .tlb file older version found in Visual Studio\VB98 folder. I removed it then it worked fine. This may not be relevent for this issue but could give you another way of thinking
There is a scroll bar at the top which has 3 options:
debug
release
configuration manager
Make sure release is selected.
I had to clear browsing data and it worked in my case

Visual Studio links although nothing has changed

I have a couple of VS 2008 projects (C++) that are linked every time I start a build, even though nothing has changed. i.e. I select "Build Solution", it compiles and links, I select "Build Solution" again, it doesn't compile anything, but links again.
This is quite annoying and I have checked everything that might cause it to link again.
Is there a way to find out why Visual Studio does or skips certain build steps?
Any input is appreciated!
I had some time to revisit the problem and a workmate gave me the tip to use "process monitor" from sysinternals to figure out which file is missing.
Lo and behold it worked! It turns out that Visual Studio insists on linking against a bunch of libs even if the app does not need it. Due to an unfortunate (I guess...) chain of events, one of the default library paths disappeared from Visual Studios global settings, so VS couldn't find this lib anymore ("coredll.lib" in my case).
This didn't affect the final output, because this lib is not needed at all, but it still triggered a relink every time.
There are two possible fixes:
1) Restore the path to this lib in the global Visual Studio settings
2) Use "$(NoInherit)" in AdditionalLibraries to get rid of the unneeded lib.
I used solution #1, because #2 needs to be done for each configuration of each project because can't be done via Property Sheets.
Rebuilding can be caused also by non-existing and unused .h files belonging to the project. Since they are unused, there's no warning nor error about missing files.
Using "Process Monitor" by Sysinternals as mentioned earlier was a great hint towards figuring out the reason.
Bit of a long shot but check the date/time stamp on any dependent DLLs you have. If they are in the future then a rebuild will occur.
Edit: Also have you tried opening the .vcproj files up in an editor to check if anything's unusual? You could also try recreating them from scratch, if that's possible.

Resources