To start, I know this question has been asked a million times all over the place, but as I have no experience with VB/Visual Studio, I can't find a solution that I can make sense of.
I am creating a new VB.net project(solution?)
, and am making calls to functions from a C library
that are in a dll
file. The dll
file does have a pdb
file and they are both stored at the same location.
In the code below it shows how I declare the functions in my VB.net
code, but I have not figured out how to attach the pdb
file to the project.
Declare Function InitRelay Lib "Z:\Devel\RelayAPI\Debug\RelayAPI.dll" (ByVal setbaud As Action(Of Short), ByVal getit As Func(Of Short, Short), ByVal putit As Action(Of Short), ByVal flushit As Action, ByVal delay As Action(Of Short)) As Byte
Declare Sub FreeRelay Lib "Z:\Devel\RelayAPI\Debug\RelayAPI.dll" ()
...
I am getting an exception somewhere in the DLL file, but the way I have it set up, I can not debug the dll file. Whether its adding breakpoints, or print statements, I need a way to see where in the dll
the project fails.
Questions I have looked at:
- How to debug a referenced dll - I tried following the menu path given in the accepted answer, but when I go to Project >> Project Properties I see no Build option. It also says I can load symbols directly in the IDE if I don't want to copy any files, but I cannot find an explanation on how to do it. EDIT - As Plutonix says below, C# Build is the equivalent of VB's Compile tab. I checked and my
Debug Info
is set toFull
, so this does not solve my problem. - Debugging a third-party DLL in Visual Studio? - This talks about a
DLL
in a.NET
language but mine is in C. It also only tells you how to view the code, which I already can do. I have access to the .c and .h files that are used to create thedll
, I just cannot debug them at runtime.