Customer has a managed code .NET solution in Visual COBOL where many of the programs to be called actually reside in managed code class library assemblies, (.DLLs) that reside on a network share called \\compname\myprograms.
When I try to call one of these programs I get the following error:
Could not load file or assembly 'file://\\compname\myprograms\ManagedCustomer.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
If I move the programs to a folder on the local drive it works correctly.
How can I configure this to load my programs from a network share?
This error occurs because of the User Access Control Trust issues associated with .NET assemblies. Assemblies downloaded from the Internet or that reside on a network drive are not trusted by default.
To allow for these assemblies to be loaded you can add the following highlighted section to your app.config file. (If you don't currently have an application configuration file in your project, one can be added by right clicking on the project name, selecting Add-->New Item-->Application Configuration File)