Running Coolite Controls in Shared Hosting Environment (Medium Trust)

  1. #1

    Running Coolite Controls in Shared Hosting Environment (Medium Trust)

    I have noticed that the scriptmanager control throws a SecurityException on a shared host:

    [SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
       System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
       System.Security.CodeAccessPermission.Demand() +59
       System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +65
    It appears that because of shared host runs ASP.NET applications at medium trust and not full trust, the control fails.

    I was wondering if this can be helped? Or do I pretty much have to use it on a dedicated host?

    Thanks in advance
  2. #2

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)



    Full Trust should not be a requirement. We have the proper AspHostingPermission attributes in the source, but maybe we're missing something else.

    Let me run a few tests.
    Geoffrey McGill
    Founder
  3. #3

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)



    Thanks for the quick reply. In case you're curious this is all I have:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestWebSite.HomePage" %>
    
    
    <%@ Register Assembly="Coolite.Web.UI" Namespace="Coolite.Web.UI" TagPrefix="cool" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Hello World!</title>
    </head>
    <body>
        <cool:ScriptManager ID="ScriptManager1" runat="server" Hide="True" />
        <form id="form1" runat="server">
        </form>
    
    
        <script type="text/javascript">
          Ext.Msg.alert('Hello World', 'Hello World!');
        </script>
    
    
    </body>
    </html>
    But if I remove the scriptmanager and use the extjs js and css + images, it works (of course)
  4. #4

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)



    Thank for the update.

    I've tracked down the source of the error. Within the Coolite.Web.UI.ResourceManager (.HasHandler()) we try to read from the Web.config to determine if a certain coolite specific HttpHandersSection has been set. Unfortunately MediumTrust does not allow.

    I'm trying to track down a fix or work-around.
    Geoffrey McGill
    Founder
  5. #5

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)



    Ok, I have the Assembly working in Medium Trust. I had to do some rework of HasHandler, but everything seems to work well.

    The code will be included in the next release (v0.4) of the controls due out at or around the first week of March.

    Reference for others, if you want to switch into Medium Trust mode, add the following <trust> node to your web.config within <system.web>.

    <system.web>
        <trust level="Medium" />
    <system.web>
    Geoffrey McGill
    Founder
  6. #6

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)

    Thanks! Will look forward to the release.
  7. #7

    RE: Running Coolite Controls in Shared Hosting Environment (Medium Trust)



    Just wanted to update that Geoffrey let me test out a new build to see if it fixed my problem, and I'm gladly reporting that it did! I now don't have to worry about switching hosts and can enjoy this wonderful library!

    Thanks a lot!

Similar Threads

  1. [CLOSED] Shared store with buffered grid
    By Justin_Wignall in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 05, 2012, 2:00 PM
  2. [CLOSED] Hosting in Shared Server
    By P2E in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 23, 2012, 10:02 AM
  3. .Net 4.0, grid hosting controls not showing
    By tallman in forum 1.x Help
    Replies: 14
    Last Post: Aug 30, 2011, 10:00 PM
  4. Problem with coolite running in iis5.1
    By lxl000 in forum 1.x Help
    Replies: 0
    Last Post: Jul 27, 2010, 1:41 AM
  5. Replies: 3
    Last Post: Jun 07, 2010, 7:04 AM

Posting Permissions