简体   繁体   中英

VS 2013 the breakpoint will not currently be hit. no symbols have been loaded for this document

VS2013, windows 8.1, windows phone 8 c# app Breakpoints not working and i got the breakpoint will not currently be hit. no symbols have been loaded for this document error what i need to do?

图片

I struggled forever trying to fix this. Finally this is what did it for me.

Select Debug -> Options -> Debugging -> General

Tick Enable .NET Framework source stepping.

(This may be all you need to do but if you are like me, you also have to do the ones stated below. The below solution will also fix errors where your project is loading old assemblies/.pdb files despite rebuilding and cleaning.)

Select Tools -> Options -> Projects and Solutions -> Build and Run ,

Untick Only Build startup projects and dependencies on Run ,

Select Always Build from the On Run, when project are out of date dropdown.

You should build your project, if it is build be sure that you attach to right process ! If you are sure that this 2 are okay, clean the solution and rebuild again.

Usually this means that any of your assemblies has changed but was not not re-built, or to be more precise the Debug-Information-File (PDB) is not recent. Therefor the debugger does not know the right source-text and therefor cannot step into. Rebuilt the assemblies and attach it to the right process.

Also you may take into consideration that assemblies built for .NET 3.5 downwards may not be processed together with assemblies for .NET 4.0 upwards, you cannot debug both types at the same time.

EDIT: To ensure what I mentioned before check which type of assembly the debug-info is generated for. When attaching your assembly to an existing process press the select-button behind "attach to". There you can select the right type if not automatically done.

For me it helped to kill IIS (if used (ASP.Net)) and to close and restart Visual Studio. It maybe sounds very stupid but also sometimes it helps to just reboot.

当我遇到这个问题时,我解决这个问题的方法是断开团队基础服务器(TMS) - 因为我正在使用它 - 并重新发布网站。

For me even the latest code changes also not get effected in the application. Therefore I made a small compilation error in the code where breakpoints are located then try to run the solution after clean build. It hits the error and then I correct the error and run it again, now even it hits the breakpoints.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM