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

Forums / Bugs & Issues / Dashboard causing error in custom module

Dashboard causing error in custom module

7 posts, 0 answered
  1. Mika Moser
    Mika Moser avatar
    4 posts
    Registered:
    26 Jan 2010
    22 Dec 2009
    Link to this post
    Ok, this is a weird one...

    Let me set the stage:
    The production env: Rackspace Cloud with their Custom Medium Trust Level (downloadable here)
    The Module: C#, ASP.NET 3.5, Data modeled with the Entity Framework
    SiteFinity Ver: 3.7

    Here's what happeneing:
    The module works just fine, every part of it (public display, public admin, sitefinity admin) until the dashboard is accessed with dashboard boxes open.

    No error is being thrown in the admin, but a Security Exception is being thrown on my custom module in the Provider while trying to access the EF.

    What's I've done this far:
    I've opened the sitefinity/admin/default.aspx.cs and commented out the following lines and it works, but if you uncomment anything in those lines my module dies.

        private void LoadDashboardRecentItems() 
        { 
            using (CodeBenchmark.Start()) 
            { 
                plhDashboardItems.Controls.Clear(); 
      
                /*foreach (IPersonalizedDashboardItem item in GlobalDashboardItems.Instance.DashboardItems)
                {
                    plhDashboardItems.Controls.Add((WebControl)item);
                }
                foreach (IWebModule module in ModuleManager.WebModules.Values)
                {
                    IPersonalizedDashboard personalizedModule = module as IPersonalizedDashboard;
                    if (personalizedModule != null)
                    {
                        foreach (IPersonalizedDashboardItem item in personalizedModule.DashboardItems)
                        {
                            plhDashboardItems.Controls.Add((WebControl)item);
                        }
                    }
                }*/ 
            } 
        } 
     
     
        protected void Page_Load(object sender, EventArgs e)   
        {   
            ...   
                    inTrayInfo = new PagesInTrayInfo((string)this.GetLocalResourceObject("Pages"), 
                        (string)this.GetLocalResourceObject("RecentlyModified"));   
                    inTrayInfo.SortBy = "DateModified";   
                    inTrayInfo.SortDirection = System.ComponentModel.ListSortDirection.Descending;   
                    dbbPages.DataSource = inTrayInfo.GetAsDataSource();   
                    /*dbbPages.DataBind();*/   
            ...   
        }   

    Is this a known issue? Any ideas of a work around, other than commenting all this out or turning off the dashboard boxes? 

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Dec 2009
    Link to this post
    Hi Chris,

    Could you please send us the Sitefinity.log file, so we can check what the exact security permission is?

    Thank in advance.  

    Kind regards,
    Georgi
    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. Mika Moser
    Mika Moser avatar
    4 posts
    Registered:
    26 Jan 2010
    22 Dec 2009
    Link to this post
    Georgi,
    Thanks for your fast response...

    I'd send it, but the only problem is with Rackspaces Trust level I have to turn Health monitoring off in-order for the site to work.  So there really isn't any information from the tests I've been running in the file.

    --Chris
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Dec 2009
    Link to this post
    Hello Chris,

    I have downloaded the custom trust settings and got the exception. The missing component is the Reflection permission, which unfortunately is in heavy use in the dashboard section. The dashboard is taking the type of every module attached. 

    I apologize that we are not helpful with this reply.

    Kind regards,
    Georgi
    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. Mika Moser
    Mika Moser avatar
    4 posts
    Registered:
    26 Jan 2010
    28 Dec 2009
    Link to this post
    That's really odd since the followings line in the custom trust config...

    <SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
     
    ... 
     
    <IPermission class="ReflectionPermission" version="1" Unrestricted="true"/> 

    I wonder if one of the other permission assignments is bumping it out... or if it's some other issue with ReflectionPermissions... either way, it's not SiteFinity's issue.

    Thanks for your help!


  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Dec 2009
    Link to this post
    Hello Chris,

    I reviewed the whole configuration file for medium trust that Rackspace is exposed. The configuration settings seems to be correct. We support the standard configuration settings for medium trust. If the hosting provider has added some additional restriction this could be a reason for the problem you have. It seems that there is some additional restriction , since server Security Exception is thrown.

    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.
  7. liu
    liu avatar
    6 posts
    Registered:
    19 Apr 2011
    06 May 2011
    Link to this post
    Now I come to the same issue ,can you tell me how to resolve this issue except to comment the following code:

                //foreach (IPersonalizedDashboardItem item in GlobalDashboardItems.Instance.DashboardItems)
                //{
                //    plhDashboardItems.Controls.Add((WebControl)item);
                //}


                //foreach (IWebModule module in ModuleManager.WebModules.Values)
                //{
                //    IPersonalizedDashboard personalizedModule = module as IPersonalizedDashboard;


                //    if (personalizedModule != null)
                //    {
                //        foreach (IPersonalizedDashboardItem item in personalizedModule.DashboardItems)
                //        {
                //            plhDashboardItems.Controls.Add((WebControl)item);
                //        }
                //    }
                //}



    Thanks


Register for webinar
7 posts, 0 answered