Debugging .NET Code from Delphi

Posted on

Debugging .NET Code from Delphi

You can debug .NET code even though your main program is written in Delphi. You will need Visual Studio, but even the free Express Edition should work.

In Delphi

Compile your Delphi application to make sure the .exe is current.

In Visual Studio

Make sure that target is Debug and not Release for the assemblies you want to debug.

Now modify the project properties for any one of the .NET assemblies used via CrossTalk. Select the Debugging tab.

In the Command field, enter the full path and name of your Delphi executable. Now select the same assembly as your start up project and run from Visual Studio. Set some breakpoints. Now run the solution. Visual Studio will launch your Delphi application, and when it makes calls via CrossTalk into your assemblies the breakpoints you set will be triggered. From there you can set watches, or perform any other Visual Studio debugging action.