Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symbols are created but debugging never stops at break point

How do I get my breakpoints working?

I am getting this message when running a C# console app in debug mode:

enter image description here

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

Here are other specs related to this issue:

Microsoft Visual Studio Professional 2015 Version 14.0.25123.00 Update 2 Microsoft .NET Framework Version 4.6.01055

Installed Version: Professional

ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11106.0 ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0 For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0 For additional information, visit http://www.asp.net/

Code alignment 12.1 Code alignment helps you present your code beautifully, enhancing clarity and readability.

CodeMaid 10.1.93 CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.

Common Azure Tools 1.7 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

ConfigurationTransform 1.3 Automatically transform app.config during build process. Once the transformation is set, it will run on other build machines without the extension.

GitHub.VisualStudio 1.0 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service 2.0 JavaScript Language Service

JavaScript Project System 2.0 JavaScript Project System

JetBrains ReSharper Ultimate 10.0.2 Build 104.0.20151218.120627 JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure Mobile Services Tools 1.4 Microsoft Azure Mobile Services Tools

Node.js Tools 1.1.31117.00 Adds support for developing and debugging Node.js apps in Visual Studio

Node.js Tools - Profiling 1.1.31117.00 Profiling support for Node.js projects.

NuGet Package Manager 3.4.3 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

NuGet References 1.0 Save time by managing your NuGet references right from the Solution Explorer packages.config

PreEmptive Analytics Visualizer 1.2 Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools 14.0.60311.1 Microsoft SQL Server Data Tools

StyleCop 4.7 Provides source code style and consistency tools. See https://github.com/Visual-Stylecop/Visual-StyleCop for more details.

TypeScript 1.8.30.0 TypeScript tools for Visual Studio

Here are my debugging settings:

enter image description here enter image description here enter image description here enter image description here enter image description here

Here are my settings for the projects:

enter image description here enter image description here enter image description here

Here are the packages I am using:

 <package id="EntityFramework" version="6.1.3" targetFramework="net452" />
  <package id="log4net" version="2.0.3" targetFramework="net452" />
  <package id="Magnum" version="2.1.3" targetFramework="net452" />
  <package id="MassTransit" version="2.9.9" targetFramework="net452" />
  <package id="MassTransit.Log4Net" version="2.9.9" targetFramework="net452" />
  <package id="MassTransit.MSMQ" version="2.9.0" targetFramework="net452" />
  <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net452" />

Other references not covered by nuget:

enter image description here

  1. The solution is made up of 2 projects: consoleProject, classLibraryProject.
  2. consoleProject references classLibraryProject.
  3. When going to debug->windows->Modules for classLibraryProject I am getting the message "Could not find or open the PDB file.
  4. When manually building the PDB for classLibraryProject and moving it into the bin\Debug for consoleProject, then I get a symbol status of "Symbols Loaded." **However, the breakpoints are not honored. **
  5. Yes, I am certain that the code is triggered because the side effects of the code are visible.

How do I get my breakpoints working?

like image 582
Alex Gordon Avatar asked Apr 28 '16 17:04

Alex Gordon


2 Answers

I just created new console app + class library. Please be sure that console app has reference on class library (like on image)

enter image description here

I wrote that because I don't see that on your screens.

Than plz right click on solution and select "properties..." You will see smth like that: enter image description here Check that configuration + platform are equal for your projects and that checkboxes 'Build' are both selected. If that checkboxes are selected then after 'clean build' of you solution you will see smth like that in the bin\Debug folder of colsole app:

enter image description here

Please notice that class library has 2 files (highlighted on screen): dll + pdb. In that case dll+pdb are in synchro state and your breakepoints will work in class library code.

If you have no pdb file for class library project after build than may be your reference on class library is NOT a reference on a VS project. Please check that you added reference correctly (like on image):

enter image description here

DO NOT reference on dll file of class library directly via 'Browse' dialog.

You can check that your console app refenced correctly on class library project - please open console app csproj file on edit and look on reference:

enter image description here

If you have BAD refence (on a .dll file):

enter image description here

than delete that reference via context menu in VS and add a correct one.

I hope that will help you.

like image 51
Artyom Avatar answered Oct 05 '22 03:10

Artyom


You have my sympathy for trying to fix this. When I compare settings with mine I find 2 differences in Debugging|General:

  1. check: Suppress JIT optimization on module load
  2. uncheck: Load dll exports

The first one may fix your problem.

like image 41
Dick Bos Avatar answered Oct 05 '22 04:10

Dick Bos