用vs2008开发的应用程序在vs2012中打开时提示如下:

此方法显式使用的 CAS 策略已被 .NET Framework 弃用。若要出于兼容性原因而启用 CAS 策略,请使用 NetFx40_LegacySecurityPolicy 配置开关。

从网上搜索了相关资料,查看了微软帮助文件 ,提到的方法大致两种 :

1、在vs默认安装目录下的C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config中添加

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

本地试过此种方法,不管用。

2、在应用程序的配置文件 web.config中添加:

<system.web>

<trust level="Full" legacyCasModel="true"/>

 </system.web>

添加后,应用程序正常运行。

相关文章:

  • 2021-10-28
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2022-01-22
  • 2021-07-14
  • 2021-08-24
  • 2021-09-01
相关资源
相似解决方案