Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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

share|improve this question

1 Answer 1

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: meta.stackexchange.com/questions/2950/… ... 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

 
discard

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.