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

Forums / Deployment / Deployment to shared hosting with medium trust

Deployment to shared hosting with medium trust

30 posts, 1 answered
  1. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    08 Sep 2009
    Link to this post
    hello,

    I have been playing with sitefinity 3.7, i have the user manual for 3.7 but it does not mention anything about deployment to shared server.

    Could someone list the steps needed to deploy a sitefinity website to shared server with medium trust.

    What functionality do i loose if i host a website in medium trust?

    Thanks

    Mehdi
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Sep 2009
    Link to this post
    Hi Mehdi,

    In medium trust you cannot use HealthMonitoring and Workflow. Depending on your host provider there could be issues related to RadUpload - uploading of files, uploading of zip, RadProgressArea should be also disabled.

    Before setting the trust level to medium, make sure you modify the application web.config file as
    described below:
    1. Disable page and module workflow *:

    <add connectionStringName="DefaultConnection" 
    allowPageHistory="false" 
    allowPageWorkflow="false" name="Sitefinity" 
    type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" /> 
    … 
    <add name="Generic_Content" visible="True" defaultMetaField="Name" 
    securityProviderName="" allowLocalization="False" 
    allowVersioning="True" allowWorkflow="false 
    … 
    <add name="News" visible="False" defaultMetaField="Title" 
    securityProviderName="" allowLocalization="true" 
    allowWorkflow="false" 
    … 
    <add name="Blogs" visible="False" defaultMetaField="Title" 
    applicationName="/Blogs" allowVersioning="True" 
    allowLocalization="False" localizationProviderName="" 
    allowWorkflow="false" 
    … 

    2. Disable health monitoring:

    <healthMonitoring enabled="false" heartbeatInterval="0"

    3. Make sure the following lines are commented out:
    <!--add name="SitefinityXml" securityProviderName="" 
    type="Telerik.Lists.Data.XmlProvider, Telerik.Lists.Data" 
    dataFile="~/App_Data/Lists.xml" visible="true" /--> 

    The Sitefinity module providers cannot get their database objects created in medium trust environment
    and you may get errors. To prevent this, you need to enforce database upgrade in full trust environment,
    in your local Web site. Creating at least one content item in each module before uploading the upgraded
    database to the production server and setting the trust level to medium will initialize all modules in the
    database. The Sitefinity Search service does not work in medium trust environment.
    RadMemoryOptimization requires ReflectionPermission in order to operate correctly. This means that
    in normal circumstances you will have to run your application with Full Trust permissions set, unless
    you create a custom security policy, which allows ReflectionPermission. If you are unable to set Full
    Trust or custom security policy, the solution is to put the Prometheus controls assembly in GAC.
    The Upload Control functionality is not available in medium trust environment. You need to upload the
    controls manually through the application web.config file.The upload of .ZIP files in the Images & Documents module is currently not possible in medium trust
    environment.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    07 Oct 2009
    Link to this post
    Hi Ivan,

    I'm trying to get SiteFinity to work on my shared hosting environment.. but,
    What do you mean by:  The Upload Control functionality is not available in medium trust environment. You need to upload the controls manually through the application web.config file?

    I hope you can help me out,
    Thanks in advance,
    Tys



  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Oct 2009
    Link to this post
    Hi Tys,

    You need to register the control in your web.config file as the example below shows:

     <toolboxControls> 
            <clear /> 
            <add name="Control" section="Most popular" type="CustomCompiledControls.SampleControl, CustomCompiledControls" /> 
            <add name="Control1" section="Most popular" url="~/UserControls/test.ascx" /> 
     
    ... 
       ... 


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    07 Oct 2009
    Link to this post
    Ivan, Thanks for your reply,
    Just to be sure, the problem i have is with the upload functionality, that doesn't work within my shared hosting environment. Can that be fixed by registering a specific control as a toolboxcontrol?
    If so, what code should i use to do so? Because from your example, i've tried some things, but nothing worked.
    Kind Regards, Tys
  6. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    07 Oct 2009
    Link to this post
    Ivan, Reading this again and examining the web.config a bit more, i'm pretty sure we have a small misunderstanding. I was looking at uploading images etc, not controls. But in the end, the underlying problem is the same i guess. The medium trust level has to be modified for any uploading functionality, am i right? Can you give me that line that has to be added to the policy file, so i can pass that on to my hosting provider?
    Thanks in advance, Tys
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Oct 2009
    Link to this post
    Hello Tys,

    Controls
    1.In medium trust environment you cannot upload controls through Toolbox section.

    Images and documents

    1. Please take a look at this article - Trust permissions set


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    07 Oct 2009
    Link to this post
    Thanks! That will help sorting this out.
  9. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    16 Nov 2009
    Link to this post
    hello,

    The search engine wont work in Medium trust?

    TYS: did you manage to run Sitefinity in medium trust?

    Thanks

    Mehdi
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    16 Nov 2009
    Link to this post
    Hi Mehdi,

    The search index works without problems in medium trust, Sitefinity 3.7 SP1. Of course better option is using a hosting that supports full trust environment.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    16 Nov 2009
    Link to this post
    hi ivan,
    most hosting providers don't allow full trust, as it is a security risk. I am very happy with my current hosting provider and do not want to move to another host only because they support full trust. The websites i work on are very critical so it should be without any downtime.

    Well i don't mind uploading the controls myself, i just wanted the search engine to work.

    I am currently trying to setup sitefinity in medium trust, this is the community version. Once this works fine i will be uploading the standard edition as i need multilingual website. Any other functionality will be disabled?


    thanks

    Mehdi
  12. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    17 Nov 2009
    Link to this post
    hello ivan,

    i have uploaded a test site to www.planetfireworks.com which is running in medium trust.

    could you please explain what you mean by "To prevent this, you need to enforce database upgrade in full trust environment,
    in your local Web site. Creating at least one content item in each module before uploading the upgraded
    database to the production server and setting the trust level to medium will initialize all modules in the
    database"


    I am new to this so how do i run the sitefinity in full trust locally, and where do i change the settings to medium trust? i could not find it in web.config file.

    If you see the sample site i have uploaded, the search gives error "invalid index"
    The Poll does not work, my Home page loaded at first, but now it gives an error message.
    when i go to events section and click an event the page throws error.

    do i need to configure nething else which i missed?

    Thanks

    Mehdi



  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Nov 2009
    Link to this post
    Hi Mehdi,

    By default Sitefinity is configured to run in full trust, so you do not have to change anything. The changes you need to set up the website in medium trust were listed previously above. You need to modify the project's web.config file when working in medium trust.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  14. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    17 Nov 2009
    Link to this post
    hi ivan,

    i have done exactly as you mentioned above, but when on the main page i submit a poll after that for some reason the page does not load and throws error.
    Do i have to first load the website and make sure i click on the polls, forums, blogs, events items before uploading it to the server?

    i wanted to attach the web.config file here but the upload tool wouldnt allow me even if i changed the extension to .gif as it complains the file size is small.

    Once this works fine i can go ahead and purchase the standard version for my client.

    thanks

    mehdi
  15. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    17 Nov 2009
    Link to this post
    ok here is the error message when i log in the admin panel and click on the Administration Tab:
    Cannot create directory: D:\hshome\planetfire\planetfireworks.com\App_Data\Search\All-Pages\Index   
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.   
     

    Exception Details: System.IO.IOException: Cannot create directory: D:\hshome\planetfire\planetfireworks.com\App_Data\Search\All-Pages\Index

    Other error i get is when i click on Vote for the poll:

    A generic error occurred in GDI+. Check the folder specified in the TempImagesFolder property of the control. Current value is "/App_Data/Polls_Temp". The folder should exist and must have been granted write permissions for the ASPNET user.  


    do i have to manually create the folders and give permission?

    Also when i try to use the search enginer i get this error "

    Invalid index specified: "All Pages"!"

    thanks

    mehdi

  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    18 Nov 2009
    Link to this post
    Hi Mehdi,

    ASP.NET/NETTWORK SERVICE does not have read and write permissions over App_Data folder which is essential. Please grant the asp user with read and write permissions over the above mentioned folder. 

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  17. Mehdi
    Mehdi avatar
    21 posts
    Registered:
    19 Feb 2009
    18 Nov 2009
    Link to this post
    hello ivan,

    thanks for all the help, i have created a blog here listing the steps
    http://mehdimirza.blogspot.com/2009/11/installing-sitefinity-on-shared-hosting.html

    It might be of help to others.

    thanks

    mehdi
  18. Roland
    Roland avatar
    12 posts
    Registered:
    07 Apr 2009
    29 Dec 2009
    Link to this post

    Hi,

    I am trying everything to get Sitefinity to work under a medium trust environment. Specifically Rackspace.

    Here are the steps I have taken so far:

    Followed the steps above:
    Implementing a DummyCMS to get the error...

    Which did not work because of this:
    The method or operation is not implemented.

    Line 223:        public override string GetVariable(string name)
    Line 224:        {
    Line 225:            throw new NotImplementedException();
    Line 226:        }

     

    I then went here:
    http://mehdimirza.blogspot.com/2009/11/installing-sitefinity-on-shared-hosting.html
    to see if there was something in there...

    Which led me to here: (adding impersonation - needed for the App_Data folder)
    http://cloudsites.rackspacecloud.com/index.php/How_do_I_add_impersonation_to_my_ASP.NET_site%3F

    And after 20 hours of on and off trying to get this working, I am at my wits end.

    If anyone out there has successfully launched a Sitefinity Community 3.7 sp1  ASP.NET 2.0 site on a Rackspace Cloud Site, please let me know what hoops you went through to get it to work.

    At this stage I have a local version working and talking to the production MySQL DB.
    I rebuild the site and move it up only get the following error:
    Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

    Stack Trace:

    [SecurityException: That assembly does not allow partially trusted callers.]
       Nolics.ORMapper.DataProviders.SQLDataProvider.Open() +123
       Telerik.DataAccess.NolicsHelper.SetConnection(String connectionName, String providerName) +830
       Sitefinity.Testing.DummyCmsProvider.Initialize(String name, NameValueCollection config) +185
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +673
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings) +91
       Telerik.ManagerBase`1.SetProvider(String providerName) +203
       Telerik.ManagerBase`1..ctor(String providerName) +89
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Cms.Web.UrlHelper.Initialize(CmsHttpModule cmsModule) +38
       Telerik.Cms.Web.CmsHttpModule.Init(HttpApplication context) +86
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +406
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
       System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231
    


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

    Thanks so much,
    Roland

  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Dec 2009
    Link to this post
    Hi Roland,

    I saw that you wrote in this post - That assembly does not allow partially trusted callers.
    Have you followed these suggestions:

    1. Try to delete MySql.Data.dll file from the bin folder of your project. As your hosting supports MySQL, this assembly should be in the GAC.

    2. AllowPartiallyTrustedCallers attribute is not enough to use this assembly. The options are to have it in the GAC,  or allowed System.Net.SocketPermission in the security settings. The both depends on the shared hosting. May by they do not support MySQL database with .NET applications.

    3. Your user is not able to get the SchemeVerion ;

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  20. Sarah Masood
    Sarah Masood avatar
    19 posts
    Registered:
    18 May 2010
    11 Jun 2010
    Link to this post
    hi 
    i apply "medium level trust" changes in  web.config ,i add connection string in my sitfinity project like this

    <

     

    add name="ss" connectionString="Data Source=somedatasource; Initial Catalog=testdb; User ID=testdb; Password=Ti9nG" providerName="System.Data.SqlClient"/>

     

     

     

    </

     

     

     

    connectionStrings>

     

     

     

     

     

     

     


    now when i run it using sitfinity projectManager ,it shows default.aspx page 
    instead of  Home.aspx ,as i set its property "Set as a home page" in sitifinty project manager  ,no clue y its doing it

  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jun 2010
    Link to this post
    Hello Sarah Masood,

    Go to the backend once again and set the home page. If the database is the same as this one you have use on the local host the website homepage should be displayed. If there is no home page set the website is loading the default document located in the project root.

    Best wishes,
    Ivan Dimitrov
    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.
  22. Sarah Masood
    Sarah Masood avatar
    19 posts
    Registered:
    18 May 2010
    11 Jun 2010
    Link to this post
    thanks , i get the problem ,
  23. Sarah Masood
    Sarah Masood avatar
    19 posts
    Registered:
    18 May 2010
    11 Jun 2010
    Link to this post
    where i add this line in web.config
     <trust level="Medium" />
  24. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jun 2010
    Link to this post
    Hi Sarah Masood,

    Please take a look at MSDN. Most of the host companies restrict setting the trust level from the web.config of a project, because it is set on machine level.

    Greetings,
    Ivan Dimitrov
    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.
  25. Sarah Masood
    Sarah Masood avatar
    19 posts
    Registered:
    18 May 2010
    11 Jun 2010
    Link to this post
    ok thanks
  26. Gary
    Gary avatar
    3 posts
    Registered:
    25 Mar 2009
    27 Sep 2010
    Link to this post
    Hi I have been reading through all these forums looking for an exact fix to my problem and cannot seem to find one. I am trying to deploy a Sitefinity 3.7 (SP3) Community Edition .Net 2.0 website to a shared hosting - 1and1.co.uk to be exact and am having a nightmare. I have followed all the advice in previous posts (and above) about what to disable in the web.config and am now getting this error message when clicking on a link to an image gallery and also when trying logging into the Admin area. The rest of the content appears to be showing correctly as it is locally so far!

    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) +284
       System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +69
       System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +150
       System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +30
       System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +40
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +123
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614

    1and1 do not allow the changing of the trust level and adding anything to do with trust level in the web config results in an error!

    Changing the hosting company is my last resort as this is for a customer and they are unwilling to move.

    Can someone please help as I have wasted days researching for an answer and seem to be getting nowhere!

    Many thanks
    Gary
  27. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    27 Sep 2010
    Link to this post
    Hi Gary,

    If the above suggestions do not help, then your host is using some additional restrictions and not the default policy for medium trust under which Sitefinity runs. These are server side configurations that we do not control and ASP.NET classes and methods that we use cannot work in the restricted context under which you run the project. I suggest that you should try uploading and running your project or another host or change your hosting plan.

    Best wishes,
    Ivan Dimitrov
    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
  28. Gary
    Gary avatar
    3 posts
    Registered:
    25 Mar 2009
    27 Sep 2010
    Link to this post
    Hi Ivan, thanks for your swift response.

    1and1 claim they that use a 'normal' medium trust policy. I attach a link to their config files which they allow you to download if it helps. Is there something in these files that stop my website from working?

    I do not have any other hosting plans as this is my current test hosting provider and my customer just so happens to use the same one so I need to get this working somehow!

    http://faq.1and1.co.uk/image/UK-FAQ/mshosting/config_files.zip

    Thanks
    Gary
  29. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    27 Sep 2010
    Link to this post
    Hello Gary,

    Here is a link to the default trust policy - MSDN. Some of the permissions are missing in the file you have attached. Also, the stack trace you send shows errors from classes that come form ASP.NET Framework which means that you cannot use the base things.

    Here is another similar issue which shows that this is an generic issues.

    To summarize this if you have configured the website as I suggested in this posts and Mehdi was able to host his website under medium trust and your host is not changing something in the default configuration for Medium Trust you should be able to run the website.

    Regards,
    Ivan Dimitrov
    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
  30. Gary
    Gary avatar
    3 posts
    Registered:
    25 Mar 2009
    28 Sep 2010
    Link to this post
    Hi Ivan,

    I have been in touch with 1and1 again and this is there response!

     'Thank you for contacting us.

     

    As we checked the package, we can see that your package is running on ASP.NET 2.0

    Regarding Trust Level settings on your Shared Hosting Package, please refer to the links below:

    http://faq.oneandone.co.uk/scripting/asp_net/5.html

    http://faq.oneandone.co.uk/scripting/asp_net/11.html

     If you have any further questions please do not hesitate to contact us.

     

    Sincerely,

    Errol Saniel

    Technical Support

    1&1 Internet Limited

    I am new to fairly new to ASP.NET and Sitefinity but wanted to offer this as my preferred CMS.

    Does this effect SItefinity working and are you saying the only option I have is to move to a new hosting co' such as the ones in your Hosting Partners Section?

    Many thanks

    Regards

    Gary

Register for webinar
30 posts, 1 answered