AJAX Beta 2.0 Trouble

Discussion in 'ASP.NET 2.0' started by mreyeros, Dec 5, 2006.

  1. I am receiving the following error on my page:


    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.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

    Source Error:





    Code:
    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:





    Code:
    [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
    

    Version Information:Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210 <!--
    [SecurityException]: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
    at System.Security.CodeAccessPermission.Demand()
    at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
    [SecurityException]: Request for ConfigurationPermission failed while attempting to access configuration section 'system.web/deployment'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared.
    at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
    at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
    at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
    at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
    at System.Web.Configuration.WebConfigurationManager.GetSection(String sectionName)
    at Microsoft.Web.UI.ScriptManager.GetDeploymentSectionWithAssert()
    at Microsoft.Web.UI.ScriptReference.IsDebuggingEnabled(ScriptManager scriptManager)
    at Microsoft.Web.UI.ScriptReference.ShouldUseDebugScript(String releaseName, Assembly assembly, ScriptManager scriptManager)
    at Microsoft.Web.UI.ScriptReference.GetResourceName(String releaseName, Assembly assembly, ScriptManager scriptManager)
    at Microsoft.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip)
    at Microsoft.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip)
    at Microsoft.Web.UI.ScriptManager.RegisterScripts()
    at Microsoft.Web.UI.ScriptManager.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.serviceselection_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\microsoft.net\Framework\v2.0.50727\Temporary ASP.NET Files\root\7643a1c6\f055cbb8\App_Web_fhjk1wnf.34.cs:line 0
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

    Post Edited (mreyeros) : 12/5/2006 10:27:52 PM GMT
     
  2. Try setting requirePermission="false" within your web.config.
    Btw are you getting this exception on DASP Servers?




    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 12/6/2006 2:25:24 AM GMT
     
  3. Well here is my web.config file:







    <configuration>


    <configSections>


    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <sectionGroup name="scripting" type="Microsoft.Web.Configuration.ScriptingSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <sectionGroup name="webServices" type="Microsoft.Web.Configuration.ScriptingWebServicesSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <section name="jsonSerialization" type="Microsoft.Web.Configuration.ScriptingJsonSerializationSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>


    <section name="profileService" type="Microsoft.Web.Configuration.ScriptingProfileServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>


    <section name="authenticationService" type="Microsoft.Web.Configuration.ScriptingAuthenticationServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>


    </sectionGroup>


    </sectionGroup>


    </sectionGroup>


    </configSections>





    <system.web>


    <trust level="Medium"/>


    <roleManager enabled="true" cacheRolesInCookie="true" cookieName=".CarWashRolesCookie" defaultProvider="CarWashRolesProvider">


    <providers>


    <add connectionStringName="CarWashData" applicationName="CarWashReservations" name="CarWashRolesProvider" type="System.Web.Security.SqlRoleProvider"/>


    </providers>


    </roleManager>


    <profile defaultProvider="CarWashProfileProvider" enabled="true">


    <providers>


    <clear/>


    <add name="CarWashProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="CarWashData" applicationName="CarWashReservations"/>


    </providers>


    <properties>


    <add name="FirstName" type="String"/>


    <add name="LastName" type="String"/>


    <group name="ContactNumbers">


    <add name="HomePhone" type="String"/>


    <add name="OfficePhone" type="String"/>


    <add name="CellPhone" type="String"/>


    </group>


    </properties>


    </profile>


    <authentication mode="Forms">


    <forms name="CarWashLoginCookie" loginUrl="~/default.aspx" timeout="30" slidingExpiration="true" cookieless="AutoDetect" protection="All" requireSSL="false" enableCrossAppRedirects="false" defaultUrl="~/Administration/default.aspx" path="/"/>


    </authentication>


    <authorization>


    <allow users="?"/>


    </authorization>


    <membership defaultProvider="CarWashMembershipProvider">


    <providers>


    <add name="CarWashMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="CarWashData" applicationName="CarWashReservations" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Clear"/>


    </providers>


    </membership>


    <pages>


    <controls>


    <add tagPrefix="ajax" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagPrefix="ajax" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview" tagPrefix="ajax"/>


    <add namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview" tagPrefix="ajax"/>


    </controls>


    <tagMapping>


    <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </tagMapping>


    </pages>


    <!--


    Set compilation debug="true" to insert debugging


    symbols into the compiled page. Because this


    affects performance, set this value to true only


    during development.


    -->


    <compilation debug="false">


    <assemblies>


    <add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>


    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>


    </compilation>


    <httpHandlers>


    <remove verb="*" path="*.asmx"/>


    <add verb="*" path="BusyBoxDotNet.axd" type="BusyBoxDotNet.ResourceHttpHandler, BusyBoxDotNet"/>


    <add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>


    </httpHandlers>


    <httpModules>


    <add name="WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </httpModules>


    </system.web>


    <system.net>


    <mailSettings>


    <smtp deliveryMethod="Network">


    <network host="localhost"/>


    </smtp>


    </mailSettings>


    </system.net>


    <microsoft.web>


    <scripting>


    <webServices>


    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->


    <!--


    <jsonSerialization maxJsonLength="500">


    <converters>


    <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>


    </converters>


    </jsonSerialization>


    -->


    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->


    <!--


    <authenticationService enabled="true" requireSSL = "true|false"/>


    -->


    <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved


    and modified in Atlas applications, you need to add each property name to the setProperties and


    getProperties attributes. -->


    <!--


    <profileService enabled="true"


    readAccessProperties="propertyname1,propertyname2"


    writeAccessProperties="propertyname1,propertyname2" />


    -->


    </webServices>


    </scripting>


    </microsoft.web>


    <system.webServer>


    <validation validateIntegratedModeConfiguration="false"/>


    <modules>


    <add name="ScriptModule" preCondition="integratedMode" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </modules>


    <handlers>


    <remove name="WebServiceHandlerFactory-ISAPI-2.0"/>


    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler"/>


    </handlers>


    </system.webServer>


    </configuration>
     
  4. Try getting rid of '<trust level="Medium"/>' from your web.config.

    By default, Web applications run with Full trust.




    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 12/6/2006 1:07:30 AM GMT
     

Share This Page