-1

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

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • [Please do not upload images of code/data/errors when asking a question.](http://meta.stackoverflow.com/q/285551) – martineau Jan 29 '22 at 19:42
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 08 '22 at 03:08

1 Answers1

0

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.
General Grievance
  • 4,555
  • 31
  • 31
  • 45