Denis Bubnov
Denis Bubnov

Reputation: 2795

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:

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:

The breakpoint will not currently be hit

What could be the problem? Sorry for my English.

Upvotes: 10

Views: 64750

Answers (13)

Sam Davey
Sam Davey

Reputation: 1

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.

Upvotes: 0

If the library happens to be c++ with a C# consumer project actually doing the calling into it, you need to go to Properties -> Enable Native Debugging in the consumer project, and make sure this box is checked.

Upvotes: 0

tayfun Kılıç
tayfun Kılıç

Reputation: 2843

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

Upvotes: 2

Saumil
Saumil

Reputation: 2517

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.

Upvotes: 0

David
David

Reputation: 4113

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

Solution Properties > Startup

Upvotes: 1

nandox
nandox

Reputation: 101

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

Upvotes: 0

nandox
nandox

Reputation: 101

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

Upvotes: 0

Ram
Ram

Reputation: 39

Require source files to exactly match the original version

This has to be unchecked.

enter image description here

Upvotes: 3

Denis Bubnov
Denis Bubnov

Reputation: 2795

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:

Build options

Advanced settings of build:

Advanced build settings

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

Upvotes: 24

Sudhakar MuthuKrishnan
Sudhakar MuthuKrishnan

Reputation: 333

I had similar issue and I did the following simply:

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

Uncheck this one. This worked for me.

Upvotes: 20

ilCosmico
ilCosmico

Reputation: 1459

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.

Upvotes: 1

saminpa
saminpa

Reputation: 613

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

Upvotes: 5

Pramod Harlapur
Pramod Harlapur

Reputation: 41

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

Upvotes: 0

Related Questions