+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Medium Trust Issues

Medium Trust Issues

13 posts, 0 answered
  1. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    15 Dec 2008
    Link to this post
    I just downloaded the latest Sitefinity Community Edition, follwed the recommended changes to the web.config file and set the app to run in medium trust.
    I still get the following error.

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

    I have tested on my hosting provider and locally on my pc.

    Any suggestions? Is there a possibilty there was some thing left out this release?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    15 Dec 2008
    Link to this post
    Hi JoshAnderson,

    Could you tell us when did you get this error? Are you able to log in the website and manage some parts of it? You can also paste the error entry from your Sitefinity.log file.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    15 Dec 2008
    Link to this post
    Unfortunately the log does not show any errors.

    When I load the page I get this message:

     

    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 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 failed.]
       System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
       System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
       System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
       System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +342
       System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +52
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


  4. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    15 Dec 2008
    Link to this post
    Hi Josh,

    Thanks for contacting us.

    So we can better assist you, on what page of the CMS do you receive this error? Is it on the pages tab? The modules tab? Is this error happening when you access a custom module? Are you able to log into the CMS or is this error happening when you go to http://www.mysite.com/sitefinity/login.aspx? If you set the application to run in full trust, does this error persist?

    Kind regards,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    15 Dec 2008
    Link to this post
    Yes, I do get the error on the page:

    http://www.geekandrock.com/sitefinity/login.aspx

    If I run the application in full trust, the site works fine. Unfortunately my hosting co will not allow this.

    Thanks!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    16 Dec 2008
    Link to this post
    Hi JoshAnderson,

    I am not able to browse the links to your website. It seems that the hosting provider has some kind of restriction over your folders. If you have made all settings correctly as they are shown in our User Manual, section Medium Trust Support, your application should work fine in Medium Trust, unless if there is a custom setting set by the hosting provider.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    16 Dec 2008
    Link to this post
    Ok the site is working on basic pages. Here is a link to an error.
    http://www.geekandrock.com/Resources.aspx

    Can you tell me what I need to have the hosting provider to change?

    Thanks!

     

    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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150
       System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
       System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +281
       System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +67
       System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +145
       System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +43
       System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +41
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +139
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +51
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
  8. Ricky
    Ricky avatar
    12 posts
    Registered:
    24 Sep 2012
    17 Dec 2008
    Link to this post
    Hi Josh,

    You can perform troubleshooting by checking the following

    • If you are using any custom section or using any modules that is dependent on web.config then in the configSections for that, use a requirePermission="false".
    • If your page is doing some type of WebRequest to some external url, then tell hosting provider to add that url in the web_mediumtrust.config

    Example for granting web request in medium trust (web_mediumtrust):

    <IPermission class="WebPermission" version="1"
        <ConnectAccess> 
            <URI uri="http://www\.live\.com/.*"/> 
        </ConnectAccess> 
    </IPermission> 
     

    This will grant all the request to live.com and decendants.

    Hope that helps,
    Mehfuz

  9. James
    James avatar
    5 posts
    Registered:
    08 Dec 2008
    17 Dec 2008
    Link to this post
    I believe the problem here is that ReflectionPermission is not allowed in medium trust. You can use Reflection on godaddy but not Reflection Permission -- which is unfortunate because it seems to upload ANYTHING using the CMS requires ReflectionPermission; and godaddy most likely will not put anything in GAC.
  10. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    17 Dec 2008
    Link to this post
    I sent them the instructions for modifying the medium trust on their server. Would that be all they need to do?

    1. Navigate to root\windows\Microsoft.NET\Framework\2.x\CONFIG.
    2. Open the web_mediumtrust.config file.
    3. Make sure you have following line as a child of SecurityClasses:

    <SecurityClass Name="ReflectionPermission"
    Description="System.Security.Permissions.ReflectionPermission,
    mscorlib, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089"/>

    4. Make sure you have following line among IPermission settings :

    <IPermission class="ReflectionPermission" version="1"
    Flags="RestrictedMemberAccess"/>
  11. James
    James avatar
    5 posts
    Registered:
    08 Dec 2008
    18 Dec 2008
    Link to this post
    After alot of investigation I found the problem with my upload problem; It wasn't the uploader it is the progress monitoring that references ReflectionPermision. You can remove the RadProgressHttpHandler and RadUploadModule from the web.config -- I also commented out the RadProgressManager in all of the .ascx files. While commenting out all the RadProgressManagers I noticed a property SuppressMissingHttpModuleError="true" which is probably so you can leave the control markup as is (maybe) -- I had allready commented most so I didn't see the sense in uncommenting them just to see if that is true. Not sure if this will help you with your project but it may. You will probably need to do this eventually anyhow.
  12. JoshAnderson
    JoshAnderson avatar
    9 posts
    Registered:
    26 Jul 2012
    18 Dec 2008
    Link to this post
    I tried this and unfortunately it didn't work. I am hoping my hosting co will make the changes I requested and the site will work. I am currently tied to my provider with about 20 sites. Changing will be a pain, but I may have to. I wanted to set up my blog with Sitefinity promoting SharePoint and Telerik; my favorite products. I have successfuly integrated Telerik with MOSS and love it. Hopefully something works out soon. I appreciate all of your help.
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    20 Dec 2008
    Link to this post
    Hello JoshAnderson,

    We will be happy to see your websites online. You can share the link here when everything is done.

    Let us know if there is anything else that we can do for you.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
13 posts, 0 answered