I'm developing a C# dll, called child.dll
, which will be loaded by another 3rd-party C# executable program, called parent.exe
. I don't have an access to the source code of parent.exe
.
On Visual Studio, when I want to debug my dll project, I just have to attach the debugger to parent.exe
and that's it. I can't find an easy way to do this on Xamarin Studio.
What I'm doing now are:
MONODEVELOP_SDB_TEST=1
to enable "Custom Command Mono Soft Debugger"child.dll
. This is because Xamarin Studio doesn't allow "Run with" for the library project type. By doing this, I can now access "Run with" feature of the Xamarin Studio.child.dll
to where parent.exe
want it to be and run mono --debug --debugger-agent=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:55555 parent.exe parent-args
. (Parent.exe
will load child.dll
)I'm finding a way to let other developers in my company be able to create and debug their own child.dll
under parent.exe
. I think the only unacceptable step is the fourth step which doesn't make any sense for them.
Does anyone face the same issue as mine? How did you achieve your goal?
Update Info
I've over-simplified the question. In the real scenario, I didn't manage parent.exe myself. parent.exe
has already been running (with this exact command mono --debug --debugger-agent=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:55555 parent.exe parent-args
), it was started (Process.Start) by another program as a part of the whole framework.
Basically, the workflow for developers who create child.dll is to create a dll that defines some APIs the framework needs. Then, inject the dll to the framework.
答案 0 :(得分:4)
右键单击库项目,然后单击项目选项 - >运行 - >自定义命令。在组合中,选择“执行”并输入parent.exe的路径。现在,您将能够“运行”库,并且调试器将在您放入库代码中的断点处停止。