反射加载程序时报错:An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework

湘雅三遇到,有些电脑上登陆界面打开时报错:

 

经查,发现是反射加载程序时报错:An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework

 

原因可能是,某些电脑的安全配置过高。

解决方法是:在WinformHost项目的config文件中增加配置参数:

1 <configuration>
2   ......
3   <runtime>
4     <!-- WARNING: will load assemblies from remote locations as fully trusted! -->
5     <loadFromRemoteSources enabled="true" />
6   </runtime>
7   ......
8 </configuration>

 

posted @ 2018-10-22 17:06  R&DCirurs  阅读(1611)  评论(0)    收藏  举报