Not allowed to load assembly from network location

前端 未结 2 1492
执笔经年
执笔经年 2021-02-07 11:09

I\'ve recently set up a new Windows Server 2012 R2 environment and installed Visual Studio 2012.

Now I\'m having a problem with multipl

相关标签:
2条回答
  • 2021-02-07 11:37

    Adding the loadFromRemoteSources switch to machine.config solved the problem.

    MSDN

    The loadFromRemoteSources element specifies whether assemblies from remote sources should be granted full trust.

    Example

    <configuration>
        <runtime>
           <loadFromRemoteSources enabled="true"/>
       </runtime>
    </configuration>
    

    You can find machine.config here:

    32-bit

    %windir%\Microsoft.NET\Framework\[version]\config\machine.config
    

    64-bit

    %windir%\Microsoft.NET\Framework64\[version]\config\machine.config
    
    0 讨论(0)
  • 2021-02-07 11:58

    I had the same problem, when trying to load a DLL on a local drive which came from a ZIP from the internet. The solution was to unlock the ZIP in its file properties. Finally, extracting the DLL again and now it loads without the error. No need to change the machine.config.

    0 讨论(0)
提交回复
热议问题