How to solve System.Security.SecurityException: That assembly does not allow partially trusted callers.
Recently I found myself in another shared hosting problem. Unfortunately, we are hosting our personalized-items/corporate give away website ...

System.Security.SecurityException: That assembly does not allow partially trusted callers. at DoddleReport.Web.ReportRouteConstraint.Match(HttpContextBase httpContext, Route route, String parameterName, RouteValueDictionary values, RouteDirection routeDirection) at System.Web.Routing.Route.ProcessConstraint(HttpContextBase httpContext, Object constraint, String parameterName, RouteValueDictionary values, RouteDirection routeDirection)After reading several solutions on these problem none of them work. Most specifically I've tried downloading the latest codes from codeplex (on all 3 + itextsharp from sourceforge) and modify the AssemblyInfo.css. I've added the following attribute:
[assembly: AllowPartiallyTrustedCallers]Then I set my .NET Trust Level to Medium level, you can change it by opening IIS Information Service. But still I have the same error. Looking for solution and testing locally I found out that setting my my >NET Trust Level to Full internal resolved the issue. So I found of a way on how to override this setting in web.config and found it (after system.web add the ff line):
And it worked perfectly....
5 comments
Thank you. Good job ;)
But, I don't wanna change my Trust Level :S
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using from an inherited configuration file.
Source Error:
Line 27:
Line 28:
Line 29:
Line 30:
Line 31:
YepThat was it...Thanks
But one thing to note in the snippet, tags are case-sensitive.
It should be :
...
it worked !
Post a Comment