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

a 夏天 提交于 2020-01-01 10:15:17

问题


I have solution with 3 projects. Project one - Library. Project two - Service (asmx). Project three - Test. In my service I have two config transform: PRODUCTION and TEST. They are equals, but name of databases is different. My solution:

If I Debug Test with PRODUCTION.config then all right - my breakpoints is active. If I Debug Test with TEST.config then bad. I get this:

What could be the problem? Sorry for my English.


回答1:


Fixing:

  1. Right mouse click your project
  2. Select Properties
  3. Select the Build tab
  4. Make sure Define DEBUG constant and Define TRACE constant are checked
  5. Click the Advanced button at the bottom of the Build tabpage
  6. Make sure that Debug Info: is set to Full
  7. Click OK and save changes
  8. Clean solution and rebuild the project

Link to source Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.”.

(step 6 generates the .pdb files, these are the debugging symbols)


For more information see next screenshots. Build settings:

Advanced settings of build:

Checked for Microsoft Visual Studio Enterprise 2015 and Microsoft Visual Studio Professional 2017.




回答2:


Another reason this can happen is that if you are sharing multiple projects between solutions and you have set up custom build configurations then simply changing from release to debug on the toolbar (or other shortcuts) can mess up the active build configuration and create all sorts of random consequences.

Make sure that Solution > Properties > Active Config is what you expect ('Mixed' is usually bad) and use Solution > Configuration Manager if in doubt.

I forgot again and the tactics popular on the intertubes did not, of course, work so this is partly a note to self...




回答3:


As a future reference, the same issue can happen when you have the same assembly both in GAC and bin\Debug folder. Just deleting the assembly from the GAC and it works again.




回答4:


I had similar issue and I did the following simply:

Go to Debug => Options => General => Remove the check mark for "Enable Just My Code"

This worked for me.


回答5:


Try adding or updating your .csproj file with the tag <DebugType>full</DebugType> inside <PropertyGroup>. This solved my problem.




回答6:


Require source files to exactly match the original version

This has to be unchecked.



来源:https://stackoverflow.com/questions/36445717/vs2015-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!