posts - 81, comments - 262, trackbacks - 0

SecurityException: Partially trusted callers


Most hosts have sites running at a Medium Trust level as Microsoft recommends. When a referenced dll requires full trust callers, you will be greated by:

 

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

 

The particular assembly of interest was from a third party. My initial idea was to simply dissassemble it with reflector and recompile it with the changes necessary. Unfortunately the assembly was obscured and I was not able to go with that route.

Since I couldn't dissassemble the assembly, I figured perhaps I can just edit it in place; afterall I don't care about the source. A few googles later I found Reflexil, http://sourceforge.net/projects/reflexil/. Just select the assembly and with reflexil select save as. The following prompt shows.

 

 

Select "Remove Strong Name", and on the next prompt remove it and update the assembly references. Then "cancel and keep it delay signed", this should do the trick, worked for me.

Now, this is probably not the best approach so any feedback is appreciated.

Usefull links:


Print | posted on Saturday, May 10, 2008 1:54 PM | Filed Under [ Web Programming ]

Powered by:
Powered By Subtext Powered By ASP.NET