Loading Assemblies from Network Location

.NET's default policy does not allow for loading of .NET assemblies (.dll files) from remote network locations. When attempting to load an assembly off a network path instead you get a network exception that complains about security policy.

You can override this behavior with a configuration setting in your EXE's .config file.

<configuration>
 <startup>   
    <supportedRuntime version="v4.0.30319"/>   
    <!-- supportedRuntime version="v2.0.50727"/ -->    
  </startup>
  <runtime>
**      <loadFromRemoteSources enabled="true"/>**  
  </runtime>
</configuration>

The key is the loadFromRemoteSource key which can be set to allow remote .DLL loading to occur.

**This Feature requires .NET 3.5 or later** Unfortunately this feature only works if .NET 3.5 or later is installed on the system. It'll work with .NET 2.0 runtimes but again only if .NET 3.5 is installed as that install modifies the default .NET security policy settings.

See also

Loading Assemblies from Network Locations

© West Wind Technologies, 2004-2020 • Updated: 09/29/15
Comment or report problem with topic