.NET 4.0具有
changed the default rules
安全策略。您需要创建或修改
App.config
此应用程序的文件。
代码访问安全性(由
CASPOL
)现在在.NET 4.0中被默认忽略。如果要启用它,需要将以下内容添加到
app.config
文件:
<configuration>
<runtime>
<!-- enables legacy CAS policy for this process -->
<NetFx40_LegacySecurityPolicy enabled="true" />
</runtime>
</configuration>
可以将.NET 4.0配置为使用
LoadFrom
完全信任以下配置项:
<configuration>
<runtime>
<!-- Treat assemblies from network locations as fully trusted. -->
<!-- Caution: Do not point this loaded gun at your foot. -->
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>