views:

62

answers:

2

I want to include Microsoft AntiXss V1.5 library on my live site running in a medium trust setting.However, I got an error something like:


Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

I tried this in full trust setting on my development machine and everything works good.Looks like this will run only in full trust configuration......Does anybody knows a solution or workaround for this?

A: 

Right now because of the way it works under the covers it'll only run in full trust. The AntiXSS team are aware of this problem and are now working on a new release which will run in medium trust. See their blog (by Blowdart) here.

PhilPursglove
A: 

You have a couple of options. In about 3 weeks I'll be updating the source tree on codeplex, so you can pull down the latest source and the encoding bits will work in medium trust. Html Sanitization however will require full trust for the foreseeable future.

If you want it now, then you can remove anything related to HTML sanitization from the encoding source, recompile and it will work under medium trust.

blowdart