简体   繁体   中英

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

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.

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.

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.

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

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.

Require source files to exactly match the original version

This has to be unchecked.

在此处输入图片说明

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

I am using a solution with several projects (Visual Studio 2015). In my case, the problem was solved when I realized that one of the projects was being defined with another URL in: Project properties - Web - Servers - Project Url. After changing to use the same URL as the other projects, the problem was solved.

Image

I am using a solution with several projects (Visual Studio 2015). I tried several approach. This one worked for me. In my case, the problem was solved when I realized that one of the projects was being defined with another URL in: Project properties - Web - Servers - Project Url. After changing to use the same URL as the other projects, the problem was solved.

Image

If you're doing multiple startup projects, make sure you have all your services your want to debug set to Start

解决方案属性 > 启动

In my case the project under which the debug breakpoints were not getting hit was also referenced by another solution which was at the time running. When I stopped that solution the breakpoints started hitting.

First try rebuilding your project by right mouse click the project > Rebuild If that doesn't work, try a clean of the project (right mouse click on the project > clean)

I had similar issue and I did the following: Debug=>Options=>General => Remove the check mark for "Enable Just My Code" This worked for my vs

如果库恰好是 C++ 并且有 C# 消费者项目实际调用它,则需要在消费者项目中转到 Properties -> Enable Native Debugging,并确保选中此框。

This can happen if you haven't set the current project as the startup project. In the solution explorer navigate to your project right click and select set as startup project.

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