试图通过安全透明的方法XXX访问安全至关重要的yy [英] Attempt by security transparent method xxx to access security critical yy

查看:616
本文介绍了试图通过安全透明的方法XXX访问安全至关重要的yy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习ASP.NET MVC和下一个ASP.NET MVC教程。

I'm just starting to learn ASP.NET MVC and following an ASP.NET MVC tutorials.

我在使用Visual Studio防爆preSS 2013的RC网络,并认为这可能是我的问题,是因为分页教程使用VS2012写的。

I'm using Visual Studio Express 2013 RC for Web and think that could be the reason for my problem, because the tutorial for paging is written using VS2012.

一切工作正常;但是当我添加分页的页面,使用本教程中的所有指令之一添加PagedList.mvc,一切编译罚款;当我到了特定的页面,我收到此错误信息:

Everything is works fine; but when I add paging to one of the pages, using all the instructions in the tutorial for adding PagedList.mvc, everything compiles fine; when I get to the specific page, I receive this error message:

通过安全透明的方法 'PagedList.Mvc.HtmlHelper.PagedListPager(System.Web.Mvc.HtmlHelper,PagedList.IPagedList,系统尝试。 FUNC 2)来访问安全关键型'System.Web.Mvc.MvcHtmlString失败。

Attempt by security transparent method 'PagedList.Mvc.HtmlHelper.PagedListPager(System.Web.Mvc.HtmlHelper, PagedList.IPagedList, System.Func2) to access security critical type 'System.Web.Mvc.MvcHtmlString' failed.

大会PagedList.Mvc,版本= 4.3.0.0,文化=中立,
这里公钥= abbb863e9397c5e1输入code'标有AllowPartiallyTrustedCallersAttribute程序,并使用2级安全透明度模式。 2级透明度导致AllowPartiallyTrustedCallers组件的所有方法,成为安全默认透明的,这可能是这种异常的原因。

任何人都可以给一些原因,这种情况是怎么回事?提前很多感谢和再见...

Anybody can give some reason why this situation is happening? Many thanks in advance and bye ...

推荐答案

对于我来说,页面病危以同样的方式对 Html.ActionLink 助手:

For me, the page was dying in the same way on Html.ActionLink helpers:

尝试通过安全透明的方法
  Microsoft.Web.Mvc.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,
  System.Linq.Ex pressions.Ex pression 1 LT; System.Action 1>
  System.String,System.Object的)来访问安全关键型
  System.Web.Mvc.MvcHtmlString失败。

Attempt by security transparent method 'Microsoft.Web.Mvc.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, System.Linq.Expressions.Expression1<System.Action1>, System.String, System.Object)' to access security critical type 'System.Web.Mvc.MvcHtmlString' failed.

解决的办法是做到以下几点:

The solution was to do the following:

Uninstall-Package Mvc4Futures

然后:

Install-Package Microsoft.AspNet.Mvc.Futures -Version 5.0.0

https://www.nuget.org/packages/ Microsoft.AspNet.Mvc.Futures / 5.0.0

这篇关于试图通过安全透明的方法XXX访问安全至关重要的yy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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