Asp.net网站运行在dotnet 2.0上通过CAS策略dotnet 4.0例外 [英] Asp.net website running on dotnet 2.0 through CAS policy dotnet 4.0 exception

查看:89
本文介绍了Asp.net网站运行在dotnet 2.0上通过CAS策略dotnet 4.0例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[ ^ ]

0
down vote
favorite
asp.net website running on dotnet 2.0 through CAS Policy exception on one page and display its running on dotnet 4.0. Here is exception message

"This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information."

<a href="https://i.stack.imgur.com/LsRZs.png"></a>[<a href="https://i.stack.imgur.com/LsRZs.png" target="_blank" title="New Window">^</a>]

While the website is targeted and build on dotnetfx 2.0. Everything on local IIS is running fine. I don't know what to do.





我的尝试:



我们在本地IIS上检查了它,并确保它在dotnet framework 2.0上运行。在本地IIS上,每件事都运行正常,但是在实时网站上只出现异常并且只出现在一个页面上。



What I have tried:

We have checked it on Local IIS and make sure that its running on dotnet framework 2.0. Every thing is working fine on Local IIS, but exception appear on live website and only on one page.

推荐答案

错误非常明显 - 您的实时网站正在运行.NET 4.0 AppPool。



更改实时站点以使用.NET 2.0 AppPool;或者使用.NET 4.0等效替换过时的调用;或添加配置开关。



错误消息中的链接说明了第二个和第三个选项:

代码访问安全策略兼容性和迁移 [ ^ ]
The error is pretty obvious - your live site is running in a .NET 4.0 AppPool.

Either change the live site to use a .NET 2.0 AppPool; or replace the obsolete calls with the .NET 4.0 equivalents; or add the configuration switch.

The link in the error message explains the second and third options:
Code Access Security Policy Compatibility and Migration[^]


这篇关于Asp.net网站运行在dotnet 2.0上通过CAS策略dotnet 4.0例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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