Friday, 27 September 2013

Attempt by security transparent method xxx to access security critical yy

Attempt by security transparent method xxx to access security critical yy

I posted this problem in asp.net/forums/mvc; somebody recomended I posted
here, which is more specific forum for PagedList. So I'm just going to
copy the post from asp.net/forums. Hope somebody gives a clue how to solve
this issue ...
I'm just starting to learn asp.net mvc and following one of the asp.net
site Asp.Net MVC tutorials, which are all excelent.
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.
Now, everything is working 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:
Attempt by security transparent method
'PagedList.Mvc.HtmlHelper.PagedListPager(System.Web.Mvc.HtmlHelper,
PagedList.IPagedList, System.Func`2)' to access security critical type
'System.Web.Mvc.MvcHtmlString' failed.
Assembly 'PagedList.Mvc, Version=4.3.0.0, Culture=neutral,
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.
Anybody can give some reason why this situation is happening? Many thanks
in advance and bye ...

No comments:

Post a Comment