What are the CAS policy requirements to call the method Page.TemplateControl.ParseControl?

Specifically, in SharePoint I've tried to call the method in a Minimum-trust environment, but get this error on the page:

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

However, in a medium-trust environment, no problems.

1 Answer 1


Both TemplateControl and TemplateParser requires minimal AspNetHostingPermission's so that shouldn't be a problem.

Try using PermCalc.exe (part of .NET 2.0 framework) to identify permissions needed for your assembly. It will output a permissionset where you can check the Demand elements for required permissions.

  • Nothing personal - but could you please refrain from including "Hello", "HTH" and repeating your name? The reason is to increase the signal-to-noise ratio so that answers are as useful as possible in as little text as possible. More reasons why here: meta.stackexchange.com/questions/2950/… ... Thanks :-)
    – Alex Angas
    Feb 10, 2010 at 22:37
  • gee i feel all fluffy now. Wasnt ment as self promtion tho, just common curtesy :-) Feb 11, 2010 at 8:06
  • @Anders: Yes I know! To add to my first comment, up-votes are the best way of sharing the love on the site.
    – Alex Angas
    Feb 12, 2010 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.