Why does MATLAB 7.11 (R2010b) throw an error when I try to load a .NET Assembly from a network location?

3 views (last 30 days)
When I use NET.addAssembly on an Assembly located on a network drive I receive the following error:
??? Message: Could not load file or assembly
'file://\\myServer\myShare\ClassLibrary1.dll' or one of its
dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Source: mscorlib
HelpLink:

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 16 Jan 2013
This enhancement has been incorporated in Release (R2012a). MATLAB can now load network assemblies. For previous product releases, read below for any possible workarounds:
This is expected behavior caused by a security feature of the .NET Framework 4.0 which does not allow applications (by default) to load Assemblies from network locations.
To enable MATLAB to load Assemblies from a network location, you need to update the file
$MATLABROOT\bin\[win32|win64]\matlab.exe.config:
You will need to add the following configuration options:
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
As there already should be some content in this file, the resulting file should look like:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!