Tech-Today
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 + wedding invitation (www.kalidadprintsandfavors.com) in godaddy.com. And I've just added a new feature where viewers can download the pricelist: http://www.kalidadprintsandfavors.com/pages/price-list. To ease the development I've used DoddleReport downloaded from nuget. I've downloaded the complete package for MVC3, doddlereport, doddlereport.web, doddlereport.itextsharp which automatically include itextsharp. The problem is iTextSharp requires AllowPartiallyTrustedCallers. Godaddy + itextsharp is a fatal combination which throws:
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.
-
Wordpress Cannot Add Menu Item Solved
Recently we encountered a problem wherein we cannot add anymore menu-items to our wordpress main navigation menu. On top of that the theme's menu assignment is unchecked whenever we tried to add a menu-item and hit save. Solution: Add the following...
-
Jquery Wait For All The Images To Be Loaded Before Calling An Action, Such As Image Caption
Recently I've just wanted a nice rollover caption implemented on our wedding invitation website, such on a list of wedding invitations, when you hover on one, a caption will be shown. Of course, there are some wedding invitation categories that would...
-
The Length Of The Query String For This Request Exceeds The Configured Maxquerystringlength Value. Firefox
Problem: Unrecognized configuration section httpRuntime. The length of the query string for this request exceeds the configured maxQueryStringLength value. firefox In case you experience the same error, it's because of the new feature available for...
-
Fopen() [function.fopen]: Url File-access Is Disabled In The Server Configuration
I am checking it my link verifier script is working when I have encountered this error. This is my function that checks if a url is existing. function ipiel_ping_link($obj) { $flag = 0; try { $handle = fopen($obj, "r"); if (!$handle) { $flag = 0; }...
-
Magento - 500 Internal Error
Server: 1and1 hosting After fixing the database issue, I found myself trap with: 1.) front end - I got 500 Internal Error 2.) back end - out of memory error To keep it short here are my solutions: 1 & 2.) I remember doing these things: a.) rename...
Tech-Today