Can Xamarin Studio debug a library project (dll) more easily than this?

I am developing a C # dll called child.dll

that will be loaded by another third party C # executable program called parent.exe

. I have no access to the source code parent.exe

.

In Visual Studio, when I want to debug a dll project, I just need to attach a debugger to parent.exe

and that's it. I can't seem to find an easy way to do this in Xamarin Studio.

Now I am doing the following:

  • Set env var MONODEVELOP_SDB_TEST=1

    to enable "Custom Mono Soft Debugger"
  • Start Xamarin Studio using the same terminal as the first step.
  • Uncheck "Debug project code only, don't go into framework code" in Xamarin Studio Preferences -> Debugger
  • Add a dummy exe project to the same solution of mine child.dll

    . This is because Xamarin Studio does not allow Run for the library project type. By doing this, I can now access the Run With feature in Xamarin Studio.
  • Build the entire solution, copy child.dll

    wherever parent.exe

    you 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

    download child.dll

    )
  • Set a dummy project as the startup initiator
  • Run s> Custom Mono Soft Debugger and connect to 127.0.0.1:55555

I find a way to let other developers in my company to build and debug their own child.dll

under parent.exe

. I believe that the only unacceptable step is the fourth step, which makes no sense to them.

Does anyone come across the same question as mine? How did you achieve your goal?

Update information

I have oversimplified the question. In a real-life scenario, I did not manage parent.exe myself. parent.exe

already started (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 part of the whole framework.

Basically, the workflow for developers creating child.dll is to create a DLL that defines some of the APIs that the framework needs. Then insert the dll into the framework.

+3


source to share


1 answer


Right-click the library project, then under Project Settings → Run - Custom Commands. In the combo, select Run and enter the path to parent.exe. Now you can "run" the library, and the debugger will stop at breakpoints that you put in the library code.



+4


source







All Articles