Debug from the DLL project Set breakpoints in the DLL project. Right-click the DLL project and choose Set as Startup Project. Make sure the Solutions Configuration field is set to Debug. Press F5, click the green Start arrow, or select Debug > Start Debugging.
If I understand you correctly, you want to debug a C++ coded DLL that you created, in a C# project that calls the DLL, which you also created?
I've done this before by going into your C# project properties, and under the Debug section, checking the "Enable unmanaged code debugging" check box. This should allow you to step into your C++ DLL.
To debug a C++ from C# there a couple of things you have to do.
I overcame this in Visual Studio 2019 by selecting "Enable native code debugging" as shown under my C# project's properies.
Visual Studio cannot execute a dll on its own.
You need to set the startup .exe that will be using your C++ dll in the properties of your dll project. You can do so from properties --> debugging --> command specifying the path of the executable that's gonna call your dll and any command line argument needed.
For VS 2017 Pro, go to the property page of the main project (your c# project in the solution) by right mouse clicking it. At the Debug menu item, find the option in Debugger engines, choose Enable native code debugging.
To complement the useful answers by heavyd and CCicotta and Noobie3001, in Visual Studio 2017 I also had to change the following when attaching to a running C# process calling a C++ DLL: in Debug > Attach to process ..., ensure Native code is listed by Attach to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With