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

Forums / Developing with Sitefinity / Intra-site Module on Mosso Medium Trust

Intra-site Module on Mosso Medium Trust

5 posts, 0 answered
  1. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    20 Nov 2009
    Link to this post
    I just uploaded a simple intra-site module i develop on my local server to Mosso.  Mosso is a modified medium trust level server.  

    Here is the error I am getting. 

    [SecurityException: Request failed.]  
       Telerik.Cms.Web.UI.ViewModeControl`1.AddView(String viewName, String virtualPath, String title, String description, String viewCommandCssClass, ResourceManager resources) +0  
       PastIssueControlPanel.CreateViews() in \\fs1-n01\stor1wc1dfw1\376719\378403\www.greenvilleindustry.com\web\content\App_Code\PastIssues\PastIssueControlPanel.cs:17  
       Telerik.Cms.Web.UI.ViewModeControl`1.get_Views() +96  
       Telerik.Cms.Web.UI.ViewModeControl`1.get_DefaultViewMode() +22  
       Telerik.Cms.Web.UI.ViewModeControl`1.get_ViewMode() +209  
       Telerik.Cms.Web.UI.Backend.ControlPanel`1.get_CommandPanels() +24  
       Modules.Page_Load(Object sender, EventArgs e) in \\fs1-n01\stor1wc1dfw1\376719\378403\www.greenvilleindustry.com\web\content\Sitefinity\Admin\Modules.aspx.cs:56  
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14  
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43  
       System.Web.UI.Control.OnLoad(EventArgs e) +91  
       Telerik.Cms.Web.CmsPageBase.OnLoad(EventArgs e) +55  
       Telerik.Cms.Web.AdminPage.OnLoad(EventArgs e) +20  
       System.Web.UI.Control.LoadRecursive() +74  
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6222  
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +247  
       System.Web.UI.Page.ProcessRequest() +79  
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +23  
       System.Web.UI.Page.ProcessRequest(HttpContext context) +110  
       ASP.sitefinity_admin_modules_aspx.ProcessRequest(HttpContext context) in App_Web_vgelgt2t.0.cs:0  
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +406  
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76  
     

    Here is my code for PastIssuesControlPanel.cs
    1 using Telerik.Cms.Web.UI.Backend;  
    2  
    3 /// <summary> 
    4 /// Summary description for PastIssueControlPanel  
    5 /// </summary> 
    6 public class PastIssueControlPanel : ControlPanel<PastIssueControlPanel> 
    7 {  
    8     public PastIssueControlPanel()  
    9     {  
    10         //  
    11         // TODO: Add constructor logic here  
    12         //  
    13     }  
    14  
    15     protected override void CreateViews()  
    16     {  
    17         AddView("PastIssuesListView", "~/custom/backend/PastIssues/test.ascx", "Displays all Past Issues", "Displays all Past issues.", "all", null);  
    18         //AddView("PastIssuesEditView", "~/custom/backend/PastIssues/PastIssuesEditView.ascx", "Add Past Issue", "Add a Past Issue.", "all", null);  
    19     }  
    20  
    21

    The error is on line 17: Exception Details: System.Security.SecurityException: Request failed.    The rest of Sitefinity works on Mosso I think with the exception of the Search Index sure it a FileIO bug, and the upload zip file option.   Microsoft is providing Mosso a patch in Jan or Feb for the fileIO bug.

    Am I am missing something with the inheriting the Control Panel?

    David
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    20 Nov 2009
    Link to this post
    Hi David ,

    The default configuration for Medium Trust level does not support uploading of Zip files. Make sure you modify the application web.config file as described below:

    1. Disable page and module workflow.
    2. Disable health monitoring.

    Sitefinity module providers cannot get their database objects created in medium trust environment and you may get errors. To prevent this you need to create at least one content item in each module before setting the trust level to medium. As I see it you are using custom module which throws the error, so you can check whether you are not using some custom logic and methods that are not allowed by you host security policy.Below are two links that describes each setting that applies to MedoimTrust level.

    Default ASP.NET Policy Permissions and Trust Levels
    Medium Trust Summary

    I suggest that you should build the project locally, then re upload it. If this does not help compile the module as an assembly and add it to your bin. There could be some additional restrictions on Mosso that could cause the problem.

    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. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    23 Nov 2009
    Link to this post

    Thanks Ivan,

      I am currently working on placing the module into a dll now.  I got the control panel and command panel working correctly now.  I am getting ready to test this bare bones test for any security issues on Mosso today.

    Just going through a learning curve with LayoutTemplate concept.  I am attempting to use a RadGrid in the layout template; a composite control is a pain.  Am I correct in thinking of this control as a composite control?

    I was wondering if I can just call a regular user control within the website directory to load the list of archive PDF issues into the control panel.   Similiar to the way I do when I use the simple intrasite Linqtosql process.

    Here is my new code in SaludaLabs.PastIssues for loading the composite control:

    using Telerik.Cms.Web.UI.Backend;  
     
    namespace SaludaLabs.PastIssues  
    {  
        public class PastIssuesCommand : ControlPanel<PastIssuesCommand> 
        {  
            public PastIssuesCommand()  
            {  
                //TODO: Add constructor logic here  
            }  
     
            protected override void CreateViews()  
            {  
                
                AddView<PastIssuesListView>("PastIssuesListView", "Past Issues", "Manage all Past Issues.", "all", null);   
              
                 
            }  
     
        }  

    Code for the Past Issues List View

    using Telerik.Cms.Web.UI;  
     
    namespace SaludaLabs.PastIssues  
    {  
        public class PastIssuesListView : ViewModeControl<PastIssuesCommand>   
        {  
             
            public override string LayoutTemplatePath  
            {  
                get { return base.LayoutTemplatePath; }  
                set { base.LayoutTemplatePath = value; }  
            }  
     
            protected override string LayoutTemplateName  
            {  
                get { return PastIssuesListView.PastIssuesListViewTemplateName; }  
            }  
     
             
            private const string PastIssuesListViewTemplateName = "SaludaLabs.PastIssues.Resources.listIssues.ascx";  
     
                                                         
        }  


    Code for the to intrasite Module

    using Telerik.Cms.Web.UI.Backend;  
     
    /// <summary> 
    /// Summary description for PastIssueControlPanel  
    /// </summary> 
    public class PastIssueControlPanel : ControlPanel<PastIssueControlPanel> 
    {  
        public PastIssueControlPanel()  
        {  
            //  
            // TODO: Add constructor logic here  
            //  
        }  
     
        protected override void CreateViews()  
        {  
            AddView("PastIssuesListView", "~/custom/backend/PastIssues/test.ascx", "Displays all Past Issues", "Displays all Past issues.", "all", null);  
        }  
     

    David

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Nov 2009
    Link to this post
    Hi David ,

    Generally the code seems to be correct. There are two options for implementing views from UserControl and from CustomControl. In your PastIssueControlPanel you could override CreateCommandPanelsFromUserControls where you can pass the path to your user control as well. Let me know if there is a problem with some module implementation.

    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. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    25 Nov 2009
    Link to this post
    Hi Ivan,
        Thanks for the reply.  I try out the override of the CreateCommandPanelsFromUserControls method to see if that will work with a simple hello world control to see if it works on Mosso.    

       I founded another post under bugs last night in the forums where another developer was having the exact same problem developing modules for Mosso.  It appears Mosso has something set that is not standard for the Medium trust environment.  I think we are going to move the site over to SysHosting for a better environment.  Mosso was great until they made there trust changes.  

      I am going still press on with learning how to place modules in dll, a skill I need to learn.  Look forward to some more webiniars.

    Thanks,
    David 
Register for webinar
5 posts, 0 answered