This is a migrated thread and some comments may be shown as answers.

[Solved] Html.Telerik().StyleSheetRegistrar().StyleSheets Security Exception on Medium Trust

1 Answer 161 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
cheburek
Top achievements
Rank 1
cheburek asked on 18 Jan 2011, 09:29 PM
Hi. I found that Telerik StyleSheetRegistrar and ScriptRegistrar work fine while application is in Full trust environment. In Medium trust mode
following piece of code:

Html.Telerik()
    .StyleSheetRegistrar()
    .StyleSheets( group => group
                 .AddGroup( "custom", g => g.Enabled( true ) ) );

(the same also with ScriptRegistrar)

throws exception:
 ========================================
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: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +61
   System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +99
 ======================================== 
Is there a way to work with these telerik mvc controls under Medium trust environment?
Any help would be appriciate. Thanks.

P.S. This issue seems also related to other controls from Telerik MVC package. At least I tried Grid and it also throws the same exception.
I do use .NET3.5SP1, VS2010, MVC2.0, Telerik MVC 2010 Q2

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Jan 2011, 09:10 AM
Hello cheburek,

 I tried to reproduce this with a more recent version but everything worked fine in medium trust. Do you use a modified policy file? I am sending my test project as attachment.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
cheburek
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or