It might or might not work, but you can attach to a running process:
How to debug my own DLL file that is imported to other application as a plugin?
-
30-08-2022 - |
سؤال
We created a C# project in Visual Studio, That results a DLL file. If we import that DLL file to 3rd party application it acts as a plugin. Everything is fine. But there is a bug in my DLL file which I can find it by placing a debug point. But I don't know how can I do that for DLL which is imported to 3rd party application.
المحلول 2
نصائح أخرى
Go to the Debug tab in Project Properties, set the Start Action to Launch External Process, then select the 3rd-party EXE.
Possibilities:
System.Diagnostics.Debug.Write()
may cover your case, if the 3rd party application is being run in Debug mode - you'll see the content at the Output window.- You may detect if your component is running under Visual Studio, even when hosted by another application, by checking
System.Diagnostics.Debugger.IsAttached
. If that's the case, you may dump debug information to a local file.
You can try to implement some unit tests in your project to narrow down the problem.
لا تنتمي إلى StackOverflow