Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 10:00
    Jan Kees Velthoven
    0

    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?

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 20, 2012 @ 10:04
    Lee Kelleher
    0

    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.

  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 10:06
    Jan Kees Velthoven
    0

    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:

    [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

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 20, 2012 @ 10:23
    Lee Kelleher
    0

    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".

    <add key="umbracoUseMediumTrust" value="true" />

    Then inside the <system.web> section, add:

    <trust level="Medium" originUrl=".*" />

    .. then fingers crossed!

    Cheers, Lee.

  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 10:38
    Jan Kees Velthoven
    0

    Hi Lee,

    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.

    Greetings, JK

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 20, 2012 @ 10:42
    Lee Kelleher
    0

    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.

  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 10:46
    Jan Kees Velthoven
    0

    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

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 20, 2012 @ 10:51
    Lee Kelleher
    0

    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.

  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 11:19
    Jan Kees Velthoven
    0

    Is was the log4net section.

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>

    Fixed the problem.

     

    Greetings, JK

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 20, 2012 @ 11:20
    Lee Kelleher
    0

    Great! Glad that you found the cause. :-)

    Cheers, Lee.

  • Jan Kees Velthoven 25 posts 46 karma points
    Jun 20, 2012 @ 11:21
    Jan Kees Velthoven
    0

    Thanx for the support Lee.

    Greetings, JK

Please Sign in or register to post replies

Write your reply to:

Draft