从网络位置加载程序集 [英] Load assembly from network location

查看:902
本文介绍了从网络位置加载程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图加载程序集是:

Assembly component = Assembly.LoadFrom(componentPath);

其中, componentPath 是网络位置的完整路径,并得到了以下错误:

where componentPath is a full path of network location and get the the following error:

这是试图加载来自这将导致组件在.NET Framework的previous版本被沙盒的网络位置的组件。
此版本的.NET Framework不启用CAS策略默认情况下,所以此负载可能是危险的。

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.
This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous.

如果这个负荷,不适合在沙箱总成,请启用loadFromRemoteSources switch.See <一href="http://go.microsoft.com/fwlink/?LinkId=155569">http://go.microsoft.com/fwlink/?LinkId=155569了解更多信息。

If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch.See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

您可以请explan我应该怎么做才能避免这种安全检查?

Can you please explan what should i do to avoid this security check ?

感谢您

推荐答案

阅读最佳实践集加载得到一个想法。
另请阅读本<一个href="http://blogs.msdn.com/b/shawnfa/archive/2009/06/08/more-implicit-uses-of-cas-policy-loadfromremotesources.aspx">msdn博客对.NET安全性

Read Best Practices for Assembly Loading to get an idea.
Also read this msdn blog on .NET Security

这篇关于从网络位置加载程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆