SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
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:… ... Thanks :-) – Alex Angas Feb 10 '10 at 22:37
Thanks for the answer. I will try this. – anchorPoint Feb 11 '10 at 7:09
gee i feel all fluffy now. Wasnt ment as self promtion tho, just common curtesy :-) – Anders Rask Feb 11 '10 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 '10 at 5:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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