我刚刚开始学习 ASP.NET MVC 并遵循 ASP.NET MVC 教程。
我正在使用 Visual Studio Express 2013 RC for Web 并认为这可能是我的问题的原因,因为分页教程是使用 VS2012 编写的。
一切正常;但是当我向其中一个页面添加分页时,使用教程中添加 PagedList.mvc 的所有说明,一切都编译得很好;当我到达特定页面时,我收到以下错误消息:
Attempt by security transparent method
'PagedList.Mvc.HtmlHelper.PagedListPager(System.Web.Mvc.HtmlHelper, PagedList.IPagedList, System.Func
2)访问安全关键类型'System.Web.Mvc.MvcHtmlString' failed.
Assembly 'PagedList.Mvc, Version=4.3.0.0, Culture=neutral,
enter code here PublicKeyToken=abbb863e9397c5e1' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
任何人都可以给出为什么会发生这种情况的一些原因?非常感谢提前和再见...