Skip to content

Debugging A Class Library Referenced In A Visual Studio Project

When referencing a class library .DLL file in a Visual Studios project you cannot break or step into your class library code right out of the box. When you select some implementation (Ctrl+F12) of one of your library’s classes, if you set a point you will be met with a fuzzy exclamation breakpoint that doesn’t actually break. Your breakpoints get passed by when the code is ran.

Follow these steps in Visual Studio 2019 to fix this for proper debugging purposes.

First confirm there are no issues with loading your library in your project’s reference list. If the reference isn’t loaded successfully, you might have to delete and re-add the Reference again. If this is in error the rest won’t work.

Turning off the JIT

Go to the top menu and select Tools -> Options

In the new window, Go to Debugging -> General and un-check “Enable Just My Code”

Next go to Debugging -> Just-In-Time and un-check all three options.

Loading our class library symbols

Start your project and go to Debug -> Windows -> Modules (Ctrl+D, M)

Scroll down to your class library list item, right click and select “Load Symbols”

Right click again and select “Always Load Automatically”

Fruits of our labor

Now when we run through the method we have set our breakpoint to; a break as we normally would expect. Using this procedure also saves time as every time you start up the project, you don’t have to re-configure. It will load automatically now.

Happy Debugging!

Michael has been a professional in the information technology field for over 20 years, specializing in software engineering and systems administration. He studied network security and holds a software engineering degree from Milwaukee Area Technical College with thousands of hours of self-taught learning as well. He mainly writes about technology, current events, and coding. Michael also is the founder of Sof Digital, an U.S. based software development Firm. His hobbies are archery, turntablism, disc golf and rally racing.

Comments are closed, but trackbacks and pingbacks are open.