Python 2.7 (SharpDevelop 4.4) Re: adding assemblies using CLR .Net

202 Views Asked by At

I need to find a solution to a Python problem. My code is included in the pictures for SharpDevelop 4.4. As you can see in one of the pictures (the Python console), it recognizes the clr.AddReference() function. I am using Newtonsoft.Json.dll for .Net 4. It gives an error (when run from being compiled) System.IO.IOException.

I tried to remove spaces in the folders and it still gives the same error (see picture). Does anyone know if I am missing something such as a configuration property? (Note: I am using this as a test case for loading in C# assemblies.) I will need to load several in eventually. Adding references into the project does not seem to work.

Project Source

Python Console Output

Error Screen

Removed Spaces in folders

1

There are 1 best solutions below

0
Geoffrey Gaudi On

I found the solution based on other posts:

  1. I removed the spaces in the path (not sure if this affects it)
  2. I unblocked the dll (mentioned in another post)
  3. I called clr.AddReferenceToFileAndPath(r"C:\filedir\file.dll") I confused this step before (with ToFile). This includes the full path (mentioned in another post)
  4. I am not sure if my file is a 32 or 64 bit dll (mentioned in another post) I have it set to anycpu. The reference mentioned a 32 app must ref a 32 bit dll and the same for 64 bit.