简体   繁体   English

ASP.NET Web应用程序中的CAS策略错误

[英]CAS Policy error in ASP.NET web Application

I am using Devexpress controls in my WEb forms.I added the corresponding reference to my refrences folder while on adding the control (I am using grid here) gives me error 我在我的WEb表单中使用Devexpress控件。我在添加控件时添加了对我的refrences文件夹的相应引用(我在这里使用网格)给了我错误

This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. 此方法显式使用CAS策略,该策略已被.NET Framework废弃。 In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. 为了兼容性原因启用CAS策略,请使用NetFx40_LegacySecurityPolicy配置开关。 Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information. 有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkID=155570

I checked the solutions 我检查了解决方案

and changed my web config as given in the link 并更改了链接中给出的Web配置

However I get the same error I am using VS 2010 and my .NET framework is 4 also I am running 32 bit OS XP 但是我得到了同样的错误我正在使用VS 2010而我的.NET框架也是4我也在运行32位OS XP

Please Help 请帮忙

Perhaps a little late, but you can add the following to your web.config and it should work: 也许有点晚了,但你可以将以下内容添加到你的web.config ,它应该可以工作:

<system.web>
  ...
  <trust legacyCasModel="true" />
  ...
</system.web>

I solved it by allowing full control to users in security permissions of file after closing Visual Studio 2012. File name is devenv.exe.config in the following path: 我通过在关闭Visual Studio 2012后允许用户完全控制文件的安全权限来解决它。文件名是以下路径中的devenv.exe.config:

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE

Then open above file in notepad and add following line after <runtime> tag 然后在记事本中打开上面的文件,并在<runtime>标记之后添加以下行

<NetFx40_LegacySecurityPolicy enabled="true"/>

save the file and start using Visual Studio 2012 with design view. 保存文件并开始使用带有设计视图的Visual Studio 2012。 and now my error was gone. 现在我的错误消失了。

Well I had this error earlier I solved it by changing my devenv.exe config file which is located at 好吧,我之前有这个错误我通过更改位于的devenv.exe配置文件解决了它

[C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE][1](If your Installation directory is C:) [C:\\ Program Files \\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE] [1](如果您的安装目录是C :)

What you need to do is add 你需要做的是添加

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

Between your Configuration tags...By this you would be able to resolve your problem But this gives rise to another problem...I had a dataset in another project which I could not inspect using Dataset Visualizer .The error I had was could not load this custom viewer .After hours of google search I found this Link1 and Link2 在你的配置标签之间...通过这个你可以解决你的问题但是这会引起另一个问题......我在另一个项目中有一个数据集,我无法使用数据集可视化器进行检查。我遇到的错误是不能的加载此自定义查看器 。经过数小时的谷歌搜索,我发现了这个Link1Link2

Another solution I tried was changing to webconfig file .I added this configuration and it was working in run time although I still get this error in design time. 我尝试的另一个解决方案是更改为webconfig文件。我添加了此配置,它在运行时工作,但我仍然在设计时遇到此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM