Partial / medium trust and publishing error - Umbraco 4.7.2
I've deployed a project I have been working an for two years to a shared hosting environment. When I publish a page in the conent tree I get the following error:
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=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
failed.
I use Umbrao 4.7.2 right now in combination with a MySQL 5 database. Has anyone have the same problems with this version?
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=4.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=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +99
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
I have already switched the umbracoMediumTrust keyvalue to true:
<addkey="umbracoUseMediumTrust"value="true"/>
My hosting provider does'nt allow to set the trust level value.
Is there something going on with reflection when publishing a page? The save action is going ok with no errors. What is the difference in events when saving or publishing? One thing is the writing to the umbraco.config file.
It shouldn't be an issue writing to the "umbraco.config", as I'm sure there'd be more complaints. (Personally I've been doing some dev work on upcoming 4.8 in Medium trust exclusively, which can publish fine).
Are you using any custom data-types, or 3rd-party packages? (or have upgraded any other components? e.g. Examine 1.4)
No just the standard installation of umbraco 4.7.2. Is it possible to mark any section in the web.config with requirepermission="false" to see more of the actual error? I've already done the client dependancy section.
Partial / medium trust and publishing error - Umbraco 4.7.2
I've deployed a project I have been working an for two years to a shared hosting environment. When I publish a page in the conent tree I get the following error:
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=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
I use Umbrao 4.7.2 right now in combination with a MySQL 5 database. Has anyone have the same problems with this version?
Hi Jan,
Could you post the rest of the Exception message? Specifically the stack-trace... then we can pinpoint what the root cause might be.
Thanks, Lee.
Server Error in '/' Application.
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=4.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:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Hmm... still not much to go on - not your fault, meaning the exception message isn't very detailed.
Check your Web.config file, see if the Medium Trust settings have been applied.
In your <appSettings> section, set the "umbracoUseMediumTrust" value to "true".
Then inside the <system.web> section, add:
.. then fingers crossed!
Cheers, Lee.
Hi Lee,
I have already switched the umbracoMediumTrust keyvalue to true:
My hosting provider does'nt allow to set the trust level value.
Is there something going on with reflection when publishing a page? The save action is going ok with no errors. What is the difference in events when saving or publishing? One thing is the writing to the umbraco.config file.
Greetings, JK
It shouldn't be an issue writing to the "umbraco.config", as I'm sure there'd be more complaints. (Personally I've been doing some dev work on upcoming 4.8 in Medium trust exclusively, which can publish fine).
Are you using any custom data-types, or 3rd-party packages? (or have upgraded any other components? e.g. Examine 1.4)
Cheers, Lee.
No just the standard installation of umbraco 4.7.2. Is it possible to mark any section in the web.config with requirepermission="false" to see more of the actual error? I've already done the client dependancy section.
Greetings, JK
Try adding it to the <section>s for "Examine" and "ExamineLuceneIndexSets".
(If that doesn't work... I'm pretty much out of ideas - sorry)
Cheers, Lee.
Is was the log4net section.
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
Fixed the problem.
Greetings, JK
Great! Glad that you found the cause. :-)
Cheers, Lee.
Thanx for the support Lee.
Greetings, JK
is working on a reply...