Hi,
according to this KB article : Error Loading .NET Assemblies in LabVIEW,
this MS Doc: <loadFromRemoteSources> Element | Microsoft Docs
I'm assuming that labview (LV 2016) should fail when loading an assembly from a network drive. To test the behaviour I use this code. The Load Assembly.vi is from "<LabVIEW Dir>\vi.lib\Platform\dotnet.llb".
![Load Assembly.png Load Assembly.png]()
But the VI executes properly. Inserting a Constructor Node to the block diagram and pointing it to an assembly stored on a network drive gives no error neither.
The LabVIEW.exe.config, neither the <Windows>\Microsoft.NET\Framework\v4.0.30319\Config\machine.config set the <loadFromRemoteSources> to true. So the default behaviour of .net should apply which is to block the load attempt. Why is it not happening?
What brought me to this is actually that the loading *is* blocked when (with the same configuration) I run a TestStand sequence which contains a VI that load the assembly. To make the issue more obscure the error occurs only on some machines, while i can't see how they are different. I run the sequence by a LV built operator interface. TestStand then reports the following error when running the sequence:
![ravyh_0-1575297337778.png ravyh_0-1575297337778.png]()
This can be solved by setting the <loadFromRemoteSources> to enabled="true" in the machine.config. But I'd prefer to set this in the app.config so that it could be distributed together with the application. I'm placing the "operator_interface".exe.config file in the same directory as the .exe itself, containing the following:
<?xml version ="1.0"?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>
.. but it doesn't help, the error stays. So my questions are:
- Why the app.config has no effect while the machine.config does?
- What is exactly the mechanism behind allowing/blocking loading of assemblies?
(how does the AppDomain come into play in labview, by the way?)
Thanks for any advice / information.
___
Similar topic: Loading .NET 4.0 assembly