Copied to clipboard

Flag this post as spam?

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


  • Vincent Hendriks 13 posts 35 karma points
    Mar 11, 2014 @ 14:13
    Vincent Hendriks
    0

    Umbraco 7 in Medium Trust environment

    Hi all,

    afaik Umbraco should support medium trust. I've just setup a fresh install of umbraco 7 but when changing from full trust to medium trust I get a security exception. (regarding to 'AutoMapper')

    I've already set the medium trust app setting (   <add key="umbracoUseMediumTrust" value="true" /> )

    Thanks in advance

     

    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.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 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.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Delegate.DelegateConstruct(Object target, IntPtr slot) +0
       AutoMapper.Internal.ProbingAdapterResolver..ctor(String[] platformNames) +45
       AutoMapper.Internal.PlatformAdapter..cctor() +184
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 12, 2014 @ 10:31
    Jan Skovgaard
    1

    Hi Vincent

    Actually Umbraco has decided to NOT support medium trust in v7 to make things more secure. I actually think it's also stated in the release notes but you can read it in the comments for this blog post as well http://umbraco.com/follow-us/blog-archive/2013/11/21/umbraco-7.aspx

    Hope this clarifies things :)

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 12, 2014 @ 14:54
    Jan Skovgaard
    1

    Hi Vincent

    Actually it's due to an official statement from the ASP.NET team at Microsoft, which Niels is also reffering in the comments.

    It's mentioned in this post on stackoverflow http://stackoverflow.com/a/17218344.

    /Jan

  • Johan 50 posts 174 karma points
    Dec 13, 2014 @ 07:10
    Johan
    0

    But if you are running on a web host with the key <trust level="Full"/> in your web.config does this mean that you are getting full trust or not?

    I feel that here is a need for a script that one can run to diagnose if the web host is compatibale with Umbraco 7. Right now you sign up to a web host just knowing it can run .Net but you dont know if you actually can run Umbraco 7 on it. A detection script would greatly reduce this time to find out.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 13, 2014 @ 07:23
    Jan Skovgaard
    0

    Hi Johan

    Hmm, I would never signup with a host before I was certain that they supported Umbraco. If I have any doubts about whether or not they support Umbraco I usually contact them beforehand asking them if it's possible.

    I don't see how a detection script would be of any use when you have already signed up with the host? Then you're probably gonna pay them anyway :)

    Cheers, Jan

  • Johan 50 posts 174 karma points
    Dec 13, 2014 @ 07:30
    Johan
    0

    But didnt Umbraco 4 support medium trust once upon a time? Then you are stuck with a number of Umbraco 4 users that cannot upgrade? Isnt there a big need to know this before you attempt?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 13, 2014 @ 07:49
    Jan Skovgaard
    0

    Hi Johan

    Aaah, you're of course thinking about if people who are currently running Umbraco 4 or 6 on hosting, which supports medium trust are trying to upgrade. Now I get it :) Stil a bit early for me this morning it seems.

    But yes it would be nice to have a check in the upgrade script if possible to inform them that they're currently using medium trust settings and that Umbraco 7 does not support this and they need to check with their hosting company if they support full trust.

    I think this should be added as a feature request on the issue tracker.

    Cheers, Jan

  • Andy Robinson 9 posts 96 karma points c-trib
    Jan 29, 2015 @ 12:19
    Andy Robinson
    1

    Hi all, I just had the same issue with a site that I just made live. The client is using some god-awful shared windows thing with names.co.uk. We had an umbraco 6 site up previously with no issues.

    Adding below did the job.

    <configuration>
        <system.web>
            <trust level="Full" />
        </system.web>
    </configuration>
  • Bunnynut 136 posts 318 karma points
    May 26, 2015 @ 08:46
    Bunnynut
    0

    Im having the same issues but with Umbraco 7. The problem is that im unable to use Andy's solution because i get the error that i am not allowed to set the trust to Full because it was locked at a  higher level, presumably the machine.config. Is there another way around this?

  • James Jackson-South 489 posts 1747 karma points c-trib
    May 26, 2015 @ 10:44
    James Jackson-South
    0

    Hi Bunnynut,

    On Godaddy you should be able to set the level in your web.config. If you can't then something is seriously wrong and I would suggest you move providers.

    https://support.godaddy.com/help/article/1039/what-is-medium-trust-level-and-how-does-it-affect-my-hosting-account?countrysite=uk

Please Sign in or register to post replies

Write your reply to:

Draft