0

I have installed the pythonnet package using pip install pythonnet for the purposes of capturing the output from a .dll file I have been provided. The .dll makes an API call. To run the .dll through python, I have this code:

import clr
clr.AddReference('myfile')

Running this yields the error:

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

I am unsure of how to proceed, as I am unfamiliar with C# and .dll files. I am also provided with myfile.deps.json, myfile.runtimeconfig.json, myfile.exe and myfile.pdb

How can I run this in Python?

FreyGeospatial
  • 325
  • 4
  • 17
  • 1
    If you are doing it on windows then check this: https://stackoverflow.com/a/63130697/5311735 – Evk Dec 16 '22 at 18:52

0 Answers0