I am trying to load a LabVIEW DLL in a dnxcore application. However the build of LabVIEW is very old, from 2009. So the maximum compatabillity is .NET 3.5. Therefore im using a class library that loads the DLL.

Now comes my exception. C# keeps complaining about not opening an assembly from a network location. Howver I have already set it as trusted but C# still does not trust it, probably has todo something with CAS Policies.

The fix for this issue should be setting the loadFromRemoteSources flag to true. However DNXCore does not default use xml config anymore. So tried it by JSON:

{ "runtime": { "loadFromRemoteSources": { "enabled" : true } } }

However this not seem to fix it. I also tried by xml and loading it through the ConfigurationBuilder

// Setup configuration sources. var builder = new ConfigurationBuilder() .SetBasePath(appEnv.ApplicationBasePath) .AddJsonFile("config.json") .AddXmlFile("app.config") .AddEnvironmentVariables(); Configuration = builder.Build();

And the XML:

<?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <loadFromRemoteSources enabled="true"/> </runtime> </configuration>

So I was curious has anyone already experienced this and knows a fix for this? I know the DLL works since run it from a .NET 3.5 application which does not include the CAS Policy..