Alex
Alex

Reputation: 4473

DLL loading (C#/IronPython/C#) in VS2012

I want to debug separate pieces of my application in Visual Studio 2012.

I have C# executable which works with Oracle.DataAccess dll. It works fine. Within it IronPython runtime is invoked and it works fine too. Within these IronPython modules object from main C# application is invoked and it works fine with Oracle dll.

If IronPython script is invoked standalone then it works fine and uses C# object fine as well.

However in this case C# object doesn't see Oracle dll.

To debug IronPython scripts I have to create separate Python solution so I cannot configure my C# solution. So I do not have control of C# references. GAC has right Oracle dll but how to tell C# dll to use it?

Vise versa if I'm in C# solution where I can manage the references then I cannot add py files and debug them.

In what way can I configure VS to be able to run/debug my application with dual entry C# or IronPython separately?

Upvotes: 0

Views: 405

Answers (1)

Pawel Jasinski
Pawel Jasinski

Reputation: 796

You can try replicating what "works for me". Create a solution containing:

  • python project (ironpython)
  • C# project

Add a reference to desired oracle library (Oracle.DataAccess.dll) to C# project using the standard VS mechanism. C# project should also contains a post build step to copy the resulting dll and pdb into the place where python script can find it. In my case root of the python project.

Your python project is selected as Startup Project. I use Ctrl-F5 and F5 to start it. In both cases things work as expected. In debug mode I am able to set and hit breakpoint in python and in referenced C# module. I can see the oracle library being loaded (Output window of debugger).

However:

  • The stack traces are C# only.
  • Visual Studio 2013 Update 4 together with PTVS 2.1 crashes on occasions when debugging.

Upvotes: 1

Related Questions