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

Forums / Bugs & Issues / Sitefinity 3.6 - Custom Module - Security Exception

Sitefinity 3.6 - Custom Module - Security Exception

11 posts, 0 answered
  1. Frank
    Frank avatar
    4 posts
    Registered:
    07 Dec 2008
    13 May 2009
    Link to this post

    Hi All,
    I recently created a Intra-Site Custom module based on the recent Webinar video.  The video was very expertly presented with complete instructions.
    I sucessfully completed my custom module on my development machine. 

    But after uploading to my Hosted Site (GoDaddy), I get the following error:

    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:

    Line 16:     protected override void CreateViews()
    Line 17:     {
    Line 18: AddView("UserManagerListView", "~/Custom/Modules/UserManager/Backend/Views/UserManagerListView.ascx", "View Managed Users", "Displays all Managed Users.", "all", null);Line 19:         AddView("UserManagerEditView", "~/Custom/Modules/UserManager/Backend/Views/UserManagerEditView.ascx", "Edit a Managed User", "Edit an existing Managed User.", "all", null);
    Line 20:     }

    Source File: d:\hosting\3287349\html\practiceunity\App_Code\UserManager\UserManagerView.cs    Line: 18

    Stack Trace:

    [SecurityException: Request failed.]
       Telerik.Cms.Web.UI.ViewModeControl`1.AddView(String viewName, String virtualPath, String title, String description, String viewCommandCssClass, ResourceManager resources) +0
       UserManagerView.CreateViews() in d:\hosting\3287349\html\practiceunity\App_Code\UserManager\UserManagerView.cs:18
       Telerik.Cms.Web.UI.ViewModeControl`1.get_Views() +158
       Telerik.Cms.Web.UI.ViewModeControl`1.InitializeControls(Control viewContainer) +38
       Telerik.Cms.Web.UI.ViewModeControl`1.CreateChildControls() +145
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +50
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
       System.Web.UI.Page.ProcessRequest() +86
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.sitefinity_admin_modules_aspx.ProcessRequest(HttpContext context) in App_Web_4wbux1k3.8.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    

     


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

    ==================================================

    It may have to do with medium trust security,

    Thanks for you help,

    Frank

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 May 2009
    Link to this post
    Hi Frank,

    The problem could be if you do not have access to the user controls from which you create a view or the security policy is not the default one for medium trust. It is a server side configuration.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Dino
    Dino avatar
    24 posts
    Registered:
    20 Dec 2008
    15 Oct 2009
    Link to this post
    I am having the same issue when pushing the module live on my Mosso hosted environment.  What do I need to do to fix this issue?
  4. Frank
    Frank avatar
    4 posts
    Registered:
    07 Dec 2008
    16 Oct 2009
    Link to this post
    Hi Dino,

    I was not able to solve the issue and had to implement a work-around.  I think it is a server security configuration issue.  I do not have access to the machine and could not get much help from my hosting service ($4 a month - what can I expect).

    I decided to refactor the code and create a couple of custom controls. Then, I placed them in pages that require admin authority.  The clean design of the custom modules made refactoring fairly simple.

    The result is not as nice as having a single place to go, but it gets the job done.  And only administrators have access.  Note: the custom module worked locally; just wouldn't run on the server.


    Sorry, I don't have better news,

    Frank
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Oct 2009
    Link to this post
    Hello Frank,

    Most of the cheap hosting plans modify the medium trust con figuration by adding additional restriction( because of the price and marketing) which causes a problems with web applications. It is better to have a reliable host instead of thinking for server side workarounds.

    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.
  6. Vincent
    Vincent avatar
    13 posts
    Registered:
    13 Jul 2008
    09 Mar 2010
    Link to this post
    Hi,

    Did you get workaround this problem?
  7. citytech team1
    citytech team1 avatar
    16 posts
    Registered:
    17 Sep 2009
    30 Sep 2010
    Link to this post
    Hello,

    I have created a custom module using your TestLibrary samle for overriding the LibraryItemEdit.ascx for to manage Document Module according my need.

    In my configuration file I have written

    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
        <viewMap>       
            <viewSettings hostType="Telerik.Libraries.WebControls.Admin.LibraryItemsView, Telerik.Libraries">
                <views>
                    <remove name="LibraryItemEdit"></remove>
                    <add name="LibraryItemEdit" viewType="TestLibrary.LibraryItemEditCustom, TestLibrary"></add>
                </views>
            </viewSettings>
        </viewMap>
    </controlsConfig>

    But it is giving Security Exception. I am attaching my screenshot. It is working fine in dev server.

    I gone through various post and you suggested to check the Trust Level. I have checked the trust level and it is "Full"
    I have checked
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Web.config
    Here the trust level settings

    <location allowOverride="true">
            <system.web>
                <securityPolicy>
                    <trustLevel name="Full" policyFile="internal"/>
                    <trustLevel name="High" policyFile="web_hightrust.config"/>
                    <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
                    <trustLevel name="Low" policyFile="web_lowtrust.config"/>
                    <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
                </securityPolicy>
                <trust level="Full" originUrl=""/>
            </system.web>
        </location>

    My RadUploader is working fine. But It is giving error when I am using the above configuration to override the Document Module.

    Please suggest if I am missing something else.

    Best Regards,
    Citytech
  8. citytech team1
    citytech team1 avatar
    16 posts
    Registered:
    17 Sep 2009
    30 Sep 2010
    Link to this post
    Hello,

    I want to inform you about the framework version of my application

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

    Previously the TestLibrary.dd was built in 3.5 but I have corrected it to 2.0 now. But still getting the same error.

    Regards,
    Citytech
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Sep 2010
    Link to this post
    Hello citytech,

    The application does not run if full trust. Full trust is the higher level and there are no permission restrictions there, so if you are in full trust the error would not be thrown.

    Please check the following article and compare your trust policy - ASP.NET Trust Level Summary

    Sincerely yours,
    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
  10. citytech team1
    citytech team1 avatar
    16 posts
    Registered:
    17 Sep 2009
    30 Sep 2010
    Link to this post
    Hello Ivan,

    I assumed it is Trust level. But I have shown you my level which is "Full"

    What I am doing here is Loading a Custom Template(.ascx) file.

    I am sending you my config file. Here you will see that my application is running under "Full" Trust.

    Here is my full config file.


    <?xml version="1.0" encoding="utf-8"?><!-- the root web configuration file --><configuration>
        <!--
            Using a location directive with a missing path attribute
            scopes the configuration to the entire machine.  If used in
            conjunction with allowOverride="false", it can be used to
            prevent configuration from being altered on the machine

            Administrators that want to restrict permissions granted to
            web applications should change the default Trust level and ensure
            that overrides are not allowed
        -->
        <location allowOverride="true">
            <system.web>
                <securityPolicy>
                    <trustLevel name="Full" policyFile="internal"/>
                    <trustLevel name="High" policyFile="web_hightrust.config"/>
                    <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
                    <trustLevel name="Low" policyFile="web_lowtrust.config"/>
                    <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
                </securityPolicy>
                <trust level="Full" originUrl=""/>
            </system.web>
        </location>

        <system.net>
            <defaultProxy>
                <proxy usesystemdefault="true"/>
            </defaultProxy>
        </system.net>

        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>

            <browserCaps userAgentCacheKeyLength="64">
                <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </browserCaps>

            <clientTarget>
                <add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)"/>
                <add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)"/>
                <add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.1)"/>
                <add alias="downlevel" userAgent="Generic Downlevel"/>
            </clientTarget>

            <compilation>
                <assemblies>
                    <add assembly="mscorlib"/>
                    <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                    <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                    <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                    <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add assembly="*"/>
                    <add assembly="System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>
                    <add assembly="System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>
                    <add assembly="System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                  <add assembly="System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add assembly="System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          </assemblies>
                <buildProviders>
                    <add extension=".aspx" type="System.Web.Compilation.PageBuildProvider"/>
                    <add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider"/>
                    <add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider"/>
                    <add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider"/>
                    <add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider"/>
                    <add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider"/>
                    <add extension=".resx" type="System.Web.Compilation.ResXBuildProvider"/>
                    <add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider"/>
                    <add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider"/>
                    <add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider"/>
                    <add extension=".js" type="System.Web.Compilation.ForceCopyBuildProvider"/>
                    <add extension=".lic" type="System.Web.Compilation.IgnoreFileBuildProvider"/>
                    <add extension=".licx" type="System.Web.Compilation.IgnoreFileBuildProvider"/>
                    <add extension=".exclude" type="System.Web.Compilation.IgnoreFileBuildProvider"/>
                    <add extension=".refresh" type="System.Web.Compilation.IgnoreFileBuildProvider"/>
                    <add extension=".svc" type="System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                  <add extension=".xoml" type="System.ServiceModel.Activation.WorkflowServiceBuildProvider, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          </buildProviders>
                <expressionBuilders>
                    <add expressionPrefix="Resources" type="System.Web.Compilation.ResourceExpressionBuilder"/>
                    <add expressionPrefix="ConnectionStrings" type="System.Web.Compilation.ConnectionStringsExpressionBuilder"/>
                    <add expressionPrefix="AppSettings" type="System.Web.Compilation.AppSettingsExpressionBuilder"/>
                </expressionBuilders>
            </compilation>

            <healthMonitoring>
                <bufferModes>
                    <add name="Critical Notification" maxBufferSize="100" maxFlushSize="20" urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00" maxBufferThreads="1"/>
                    <add name="Notification" maxBufferSize="300" maxFlushSize="20" urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00" maxBufferThreads="1"/>
                    <add name="Analysis" maxBufferSize="1000" maxFlushSize="100" urgentFlushThreshold="100" regularFlushInterval="00:05:00" urgentFlushInterval="00:01:00" maxBufferThreads="1"/>
                    <add name="Logging" maxBufferSize="1000" maxFlushSize="200" urgentFlushThreshold="800" regularFlushInterval="00:30:00" urgentFlushInterval="00:05:00" maxBufferThreads="1"/>
                </bufferModes>

                <providers>
                    <add name="EventLogProvider" type="System.Web.Management.EventLogWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add connectionStringName="LocalSqlServer" maxEventDetailsLength="1073741823" buffer="false" bufferMode="Notification" name="SqlWebEventProvider" type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"/>
                    <add name="WmiWebEventProvider" type="System.Web.Management.WmiWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"/>
                </providers>

                <profiles>
                    <add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/>
                    <add name="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" custom=""/>
                </profiles>

                <rules>
                    <add name="All Errors Default" eventName="All Errors" provider="EventLogProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/>
                    <add name="Failure Audits Default" eventName="Failure Audits" provider="EventLogProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/>
                </rules>

                <eventMappings>
                    <add name="All Events" type="System.Web.Management.WebBaseEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Heartbeats" type="System.Web.Management.WebHeartbeatEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Application Lifetime Events" type="System.Web.Management.WebApplicationLifetimeEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Request Processing Events" type="System.Web.Management.WebRequestEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="All Errors" type="System.Web.Management.WebBaseErrorEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Infrastructure Errors" type="System.Web.Management.WebErrorEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Request Processing Errors" type="System.Web.Management.WebRequestErrorEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="All Audits" type="System.Web.Management.WebAuditEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Failure Audits" type="System.Web.Management.WebFailureAuditEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                    <add name="Success Audits" type="System.Web.Management.WebSuccessAuditEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
                </eventMappings>

            </healthMonitoring>

            <httpHandlers>
          <add verb="*" path="*.rules" type="System.Web.HttpForbiddenHandler" validate="true"/>
          <add verb="*" path="*.xoml" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
                <add path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
                <add path="trace.axd" verb="*" type="System.Web.Handlers.TraceHandler" validate="True"/>
                <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True"/>
                <add path="*.axd" verb="*" type="System.Web.HttpNotFoundHandler" validate="True"/>
                <add path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" validate="True"/>
                <add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="True"/>
                <add path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="False"/>
                <add path="*.rem" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="False"/>
                <add path="*.soap" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="False"/>
                <add path="*.asax" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.ascx" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.master" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.skin" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.browser" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.sitemap" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.dll.config" verb="GET,HEAD" type="System.Web.StaticFileHandler" validate="True"/>
                <add path="*.exe.config" verb="GET,HEAD" type="System.Web.StaticFileHandler" validate="True"/>
                <add path="*.config" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.cs" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.csproj" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.vb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.vbproj" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.webinfo" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.licx" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.resx" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.resources" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.mdb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.vjsproj" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.java" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.jsl" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.ldb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.ad" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.dd" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.ldd" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.sd" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.cd" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.adprototype" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.lddprototype" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.sdm" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.sdmDocument" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.mdf" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.ldf" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.exclude" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*.refresh" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
                <add path="*" verb="GET,HEAD,POST" type="System.Web.DefaultHttpHandler" validate="True"/>
                <add path="*" verb="*" type="System.Web.HttpMethodNotAllowedHandler" validate="True"/>
            </httpHandlers>

            <httpModules>
                <add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
                <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
                <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/>
                <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
                <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/>
                <add name="RoleManager" type="System.Web.Security.RoleManagerModule"/>
                <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
                <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/>
                <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule"/>
                <add name="Profile" type="System.Web.Profile.ProfileModule"/>
                <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            </httpModules>

            <mobileControls sessionStateHistorySize="6" cookielessDataDictionaryType="System.Web.Mobile.CookielessData">
                <device name="XhtmlDeviceAdapters" predicateClass="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPageAdapter" predicateMethod="DeviceQualifies" pageAdapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPageAdapter">

                    <control name="System.Web.UI.MobileControls.Panel" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPanelAdapter"/>
                    <control name="System.Web.UI.MobileControls.Form" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlFormAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextBox" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlTextBoxAdapter"/>
                    <control name="System.Web.UI.MobileControls.Label" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLabelAdapter"/>
                    <control name="System.Web.UI.MobileControls.LiteralText" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLiteralTextAdapter"/>
                    <control name="System.Web.UI.MobileControls.Link" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLinkAdapter"/>
                    <control name="System.Web.UI.MobileControls.Command" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlCommandAdapter"/>
                    <control name="System.Web.UI.MobileControls.PhoneCall" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPhoneCallAdapter"/>
                    <control name="System.Web.UI.MobileControls.List" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlListAdapter"/>
                    <control name="System.Web.UI.MobileControls.SelectionList" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlSelectionListAdapter"/>
                    <control name="System.Web.UI.MobileControls.ObjectList" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlObjectListAdapter"/>
                    <control name="System.Web.UI.MobileControls.Image" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlImageAdapter"/>
                    <control name="System.Web.UI.MobileControls.ValidationSummary" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlValidationSummaryAdapter"/>
                    <control name="System.Web.UI.MobileControls.Calendar" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlCalendarAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextView" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlTextViewAdapter"/>
                    <control name="System.Web.UI.MobileControls.MobileControl" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlControlAdapter"/>
                    <control name="System.Web.UI.MobileControls.BaseValidator" adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlValidatorAdapter"/>
                </device>
                <device name="HtmlDeviceAdapters" predicateClass="System.Web.UI.MobileControls.Adapters.HtmlPageAdapter" predicateMethod="DeviceQualifies" pageAdapter="System.Web.UI.MobileControls.Adapters.HtmlPageAdapter">

                    <control name="System.Web.UI.MobileControls.Panel" adapter="System.Web.UI.MobileControls.Adapters.HtmlPanelAdapter"/>
                    <control name="System.Web.UI.MobileControls.Form" adapter="System.Web.UI.MobileControls.Adapters.HtmlFormAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextBox" adapter="System.Web.UI.MobileControls.Adapters.HtmlTextBoxAdapter"/>
                    <control name="System.Web.UI.MobileControls.Label" adapter="System.Web.UI.MobileControls.Adapters.HtmlLabelAdapter"/>
                    <control name="System.Web.UI.MobileControls.LiteralText" adapter="System.Web.UI.MobileControls.Adapters.HtmlLiteralTextAdapter"/>
                    <control name="System.Web.UI.MobileControls.Link" adapter="System.Web.UI.MobileControls.Adapters.HtmlLinkAdapter"/>
                    <control name="System.Web.UI.MobileControls.Command" adapter="System.Web.UI.MobileControls.Adapters.HtmlCommandAdapter"/>
                    <control name="System.Web.UI.MobileControls.PhoneCall" adapter="System.Web.UI.MobileControls.Adapters.HtmlPhoneCallAdapter"/>
                    <control name="System.Web.UI.MobileControls.List" adapter="System.Web.UI.MobileControls.Adapters.HtmlListAdapter"/>
                    <control name="System.Web.UI.MobileControls.SelectionList" adapter="System.Web.UI.MobileControls.Adapters.HtmlSelectionListAdapter"/>
                    <control name="System.Web.UI.MobileControls.ObjectList" adapter="System.Web.UI.MobileControls.Adapters.HtmlObjectListAdapter"/>
                    <control name="System.Web.UI.MobileControls.Image" adapter="System.Web.UI.MobileControls.Adapters.HtmlImageAdapter"/>
                    <control name="System.Web.UI.MobileControls.BaseValidator" adapter="System.Web.UI.MobileControls.Adapters.HtmlValidatorAdapter"/>
                    <control name="System.Web.UI.MobileControls.ValidationSummary" adapter="System.Web.UI.MobileControls.Adapters.HtmlValidationSummaryAdapter"/>
                    <control name="System.Web.UI.MobileControls.Calendar" adapter="System.Web.UI.MobileControls.Adapters.HtmlCalendarAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextView" adapter="System.Web.UI.MobileControls.Adapters.HtmlTextViewAdapter"/>
                    <control name="System.Web.UI.MobileControls.MobileControl" adapter="System.Web.UI.MobileControls.Adapters.HtmlControlAdapter"/>
                </device>
                <device name="UpWmlDeviceAdapters" inheritsFrom="WmlDeviceAdapters" predicateClass="System.Web.UI.MobileControls.Adapters.UpWmlPageAdapter" predicateMethod="DeviceQualifies" pageAdapter="System.Web.UI.MobileControls.Adapters.UpWmlPageAdapter">
                </device>
                <device name="WmlDeviceAdapters" predicateClass="System.Web.UI.MobileControls.Adapters.WmlPageAdapter" predicateMethod="DeviceQualifies" pageAdapter="System.Web.UI.MobileControls.Adapters.WmlPageAdapter">

                    <control name="System.Web.UI.MobileControls.Panel" adapter="System.Web.UI.MobileControls.Adapters.WmlPanelAdapter"/>
                    <control name="System.Web.UI.MobileControls.Form" adapter="System.Web.UI.MobileControls.Adapters.WmlFormAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextBox" adapter="System.Web.UI.MobileControls.Adapters.WmlTextBoxAdapter"/>
                    <control name="System.Web.UI.MobileControls.Label" adapter="System.Web.UI.MobileControls.Adapters.WmlLabelAdapter"/>
                    <control name="System.Web.UI.MobileControls.LiteralText" adapter="System.Web.UI.MobileControls.Adapters.WmlLiteralTextAdapter"/>
                    <control name="System.Web.UI.MobileControls.Link" adapter="System.Web.UI.MobileControls.Adapters.WmlLinkAdapter"/>
                    <control name="System.Web.UI.MobileControls.Command" adapter="System.Web.UI.MobileControls.Adapters.WmlCommandAdapter"/>
                    <control name="System.Web.UI.MobileControls.PhoneCall" adapter="System.Web.UI.MobileControls.Adapters.WmlPhoneCallAdapter"/>
                    <control name="System.Web.UI.MobileControls.List" adapter="System.Web.UI.MobileControls.Adapters.WmlListAdapter"/>
                    <control name="System.Web.UI.MobileControls.SelectionList" adapter="System.Web.UI.MobileControls.Adapters.WmlSelectionListAdapter"/>
                    <control name="System.Web.UI.MobileControls.ObjectList" adapter="System.Web.UI.MobileControls.Adapters.WmlObjectListAdapter"/>
                    <control name="System.Web.UI.MobileControls.Image" adapter="System.Web.UI.MobileControls.Adapters.WmlImageAdapter"/>
                    <control name="System.Web.UI.MobileControls.BaseValidator" adapter="System.Web.UI.MobileControls.Adapters.WmlValidatorAdapter"/>
                    <control name="System.Web.UI.MobileControls.ValidationSummary" adapter="System.Web.UI.MobileControls.Adapters.WmlValidationSummaryAdapter"/>
                    <control name="System.Web.UI.MobileControls.Calendar" adapter="System.Web.UI.MobileControls.Adapters.WmlCalendarAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextView" adapter="System.Web.UI.MobileControls.Adapters.WmlTextViewAdapter"/>
                    <control name="System.Web.UI.MobileControls.MobileControl" adapter="System.Web.UI.MobileControls.Adapters.WmlControlAdapter"/>
                </device>
                <device name="ChtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters" predicateClass="System.Web.UI.MobileControls.Adapters.ChtmlPageAdapter" predicateMethod="DeviceQualifies" pageAdapter="System.Web.UI.MobileControls.Adapters.ChtmlPageAdapter">

                    <control name="System.Web.UI.MobileControls.Form" adapter="System.Web.UI.MobileControls.Adapters.ChtmlFormAdapter"/>
                    <control name="System.Web.UI.MobileControls.Calendar" adapter="System.Web.UI.MobileControls.Adapters.ChtmlCalendarAdapter"/>
                    <control name="System.Web.UI.MobileControls.Image" adapter="System.Web.UI.MobileControls.Adapters.ChtmlImageAdapter"/>
                    <control name="System.Web.UI.MobileControls.TextBox" adapter="System.Web.UI.MobileControls.Adapters.ChtmlTextBoxAdapter"/>
                    <control name="System.Web.UI.MobileControls.SelectionList" adapter="System.Web.UI.MobileControls.Adapters.ChtmlSelectionListAdapter"/>
                    <control name="System.Web.UI.MobileControls.Command" adapter="System.Web.UI.MobileControls.Adapters.ChtmlCommandAdapter"/>
                    <control name="System.Web.UI.MobileControls.PhoneCall" adapter="System.Web.UI.MobileControls.Adapters.ChtmlPhoneCallAdapter"/>
                    <control name="System.Web.UI.MobileControls.Link" adapter="System.Web.UI.MobileControls.Adapters.ChtmlLinkAdapter"/>
                </device>
            </mobileControls>

            <pages>
                <namespaces>
                    <add namespace="System"/>
                    <add namespace="System.Collections"/>
                    <add namespace="System.Collections.Specialized"/>
                    <add namespace="System.Configuration"/>
                    <add namespace="System.Text"/>
                    <add namespace="System.Text.RegularExpressions"/>
                    <add namespace="System.Web"/>
                    <add namespace="System.Web.Caching"/>
                    <add namespace="System.Web.SessionState"/>
                    <add namespace="System.Web.Security"/>
                    <add namespace="System.Web.Profile"/>
                    <add namespace="System.Web.UI"/>
                    <add namespace="System.Web.UI.WebControls"/>
                    <add namespace="System.Web.UI.WebControls.WebParts"/>
                    <add namespace="System.Web.UI.HtmlControls"/>
                </namespaces>

                <controls>
                    <add tagPrefix="asp" namespace="System.Web.UI.WebControls.WebParts" assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                </controls>
            </pages>

            <protocols>
                <add name="net.tcp" processHandlerType="System.ServiceModel.WasHosting.TcpProcessProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" appDomainHandlerType="System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
                <add name="net.pipe" processHandlerType="System.ServiceModel.WasHosting.NamedPipeProcessProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" appDomainHandlerType="System.ServiceModel.WasHosting.NamedPipeAppDomainProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
                <add name="net.msmq" processHandlerType="System.ServiceModel.WasHosting.MsmqProcessProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" appDomainHandlerType="System.ServiceModel.WasHosting.MsmqAppDomainProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
                <add name="msmq.formatname" processHandlerType="System.ServiceModel.WasHosting.MsmqIntegrationProcessProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" appDomainHandlerType="System.ServiceModel.WasHosting.MsmqIntegrationAppDomainProtocolHandler, System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
            </protocols>

            <siteMap>
                <providers>
                    <add siteMapFile="web.sitemap" name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                </providers>
            </siteMap>

            <urlMappings enabled="true"/>

            <webControls clientScriptsLocation="/aspnet_client/{0}/{1}/"/>

            <webParts>
                <personalization>
                    <providers>
                        <add connectionStringName="LocalSqlServer" name="AspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                    </providers>

                    <authorization>
                        <deny users="*" verbs="enterSharedScope"/>
                        <allow users="*" verbs="modifyState"/>
                    </authorization>
                </personalization>

                <transformers>
                    <add name="RowToFieldTransformer" type="System.Web.UI.WebControls.WebParts.RowToFieldTransformer"/>
                    <add name="RowToParametersTransformer" type="System.Web.UI.WebControls.WebParts.RowToParametersTransformer"/>
                </transformers>
            </webParts>
        </system.web>
        <system.serviceModel>
            <serviceHostingEnvironment>
                <add name="net.tcp" transportConfigurationType="System.ServiceModel.Activation.TcpHostedTransportConfiguration, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                <add name="net.pipe" transportConfigurationType="System.ServiceModel.Activation.NamedPipeHostedTransportConfiguration, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                <add name="net.msmq" transportConfigurationType="System.ServiceModel.Activation.MsmqHostedTransportConfiguration, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                <add name="msmq.formatname" transportConfigurationType="System.ServiceModel.Activation.MsmqIntegrationHostedTransportConfiguration, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            </serviceHostingEnvironment>
        </system.serviceModel>
    </configuration>


    According to the above my application is runing in Full Trust.

    Also the RadUloader with Progress bar is running well in my application which is the proof that it is Full Trust.

    Please help.



  11. citytech team1
    citytech team1 avatar
    16 posts
    Registered:
    17 Sep 2009
    30 Sep 2010
    Link to this post
    Hello Ivan,

    My application is throwing exception for the following line.

    <add name="LibraryItemEdit" viewType="TestLibrary.LibraryItemEditCustom, TestLibrary"></add>

    When I commented this line then it is running well, with missing functionality.


    Also My "TestLibrary.dll" contains only one .cs file.

    namespace TestLibrary
    {

        public class LibraryItemEditCustom : LibraryItemEdit
        {
            public const string _templatePath = "TestLibrary.Resources.LibraryItemEdit.ascx";

            public LibraryItemEditCustom()
            {

            }

            private Guid contentId;      

            protected override void InitializeControls(Control viewContainer)
            {
                base.InitializeControls(viewContainer);
                this.contentId = this.DataItemId;
                LibraryManager manager = new LibraryManager();
                UserManager um = new UserManager();
                ProfileBase pb = new ProfileBase();
                CheckBoxList chklUser = UserList;
                if (chklUser != null)
                {
                    foreach (string sRole in Roles.GetAllRoles())
                    {
                        if (sRole.ToLower() != "administrators")
                        {
                            foreach (string s in Roles.GetUsersInRole(sRole))
                            {
                                chklUser.Items.Add(new ListItem(s, s));
                            }
                        }
                    }                

                    string[] arrAlowedUsers = AllowedUsers.Text.Trim().Split(new char[] { ',' });
                    for (int i = 0; i < arrAlowedUsers.Length; i++)
                    {
                        foreach (ListItem li in chklUser.Items)
                        {
                            if (li.Text.ToLower() == arrAlowedUsers[i].ToLower())
                            {
                                li.Selected = true;
                                break;
                            }
                        }
                    }
                }          

                SaveButton1.Click += new EventHandler(SaveButton1_Click);
                SaveButton2.Click += new EventHandler(SaveButton2_Click);
            }

            private void SaveCustomData()
            {
                string sData = "";
                CheckBoxList chklUser = UserList;

                if (chklUser != null)
                {
                    foreach (ListItem li in chklUser.Items)
                    {
                        if (li.Selected)
                        {                       
                            sData = sData + "," + li.Text;
                        }
                    }
                }
                if (sData.StartsWith(",")) sData = sData.Substring(1);
                AllowedUsers.Text = sData;
            }

            void SaveButton2_Click(object sender, EventArgs e)
            {
                SaveCustomData();
            }

            void SaveButton1_Click(object sender, EventArgs e)
            {
                SaveCustomData();
            }

            public override System.Type LocalizationAssemblyInfo
            {
                get
                {
                    return typeof(LibraryItemEdit);
                }
                set
                {
                    base.LocalizationAssemblyInfo = value;
                }
            }

            public override System.Type AssemblyInfo
            {
                get
                {
                    return GetType();
                }
                set
                {
                    base.AssemblyInfo = value;
                }
            }

            /// <summary>
            /// Gets the name of the embedded layout template. This property must be overridden to provide the path (key) to an embedded resource file.
            /// </summary>
            /// <value></value>
            protected override string LayoutTemplateName
            {
                get
                {
                    return _templatePath;
                }
            }

            protected override Telerik.Cms.Engine.WebControls.Admin.IContentCategoriesField CategoriesControl
            {
                get
                {
                    return (IContentCategoriesField)base.Container.GetControl<Control>("Category", false, TraverseMethod.BreadthFirst);
                }
            }



            protected CheckBoxList UserList
            {
                get
                {
                    try
                    {
                        return base.Container.GetControl<CheckBoxList>("chklUser", true, TraverseMethod.BreadthFirst);
                    }
                    catch
                    {
                        return null;
                    }
                }
            }


            protected TextBox AllowedUsers
            {
                get
                {
                    try
                    {
                        return base.Container.GetControl<TextBox>("AllowedUser", true, TraverseMethod.BreadthFirst);
                    }
                    catch
                    {
                        return null;
                    }
                }
            }
        }
    }

    Regards,
    Citytech
Register for webinar
11 posts, 0 answered