Debugging a third-party DLL in Visual Studio?

后端 未结 8 1705
猫巷女王i
猫巷女王i 2020-12-06 05:03

I am using a third-party DLL. For some particular cases, a function in the DLL is throwing an exception. Is it possible to debug the DLL in the Visual Studio?

After

相关标签:
8条回答
  • 2020-12-06 05:32

    If the DLL is in a .NET language, you can decompile it using a tool like .NET Reflector and then debug against the source code.

    Or you could ask the vendor if source code is available. That's probably the easiest way.

    0 讨论(0)
  • 2020-12-06 05:33

    Building on Andrew's answer, you just treat the decompiled source code as a new library within your project and set breakpoints in the source. Remove all references to the 3rd party DLL so that it is the decompiled code that is executing.

    Other things:

    • You may be breaking the law by decompiling the code, or breaching a licensing agreement with the 3rd party vendor. Make sure to review this with someone.
    • You will want to make sure that you remove references to your decompiled version if you are shipping to other developers, or checking into a larger source tree. Easy to forget this!
    0 讨论(0)
提交回复
热议问题