where and how should i set the attribute of <location></location>

Last post 03-27-2008 1:44 PM by Bruce L. 3 replies.

Sort Posts:

  • where and how should i set the attribute of <location></location>

    03-26-2008, 8:57 AM
    • Member
      46 point Member
    • jack2006
    • Member since 12-17-2007, 10:05 AM
    • Posts 102

    <?xml version="1.0"?>
    <!--
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration>


        <configSections>
          <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
              <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
              <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
                <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
              </sectionGroup>
            </sectionGroup>
          </sectionGroup>
        </configSections> 


        <appSettings/>
        <connectionStrings/>
        <system.web>
            <!--
                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="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
              </assemblies>

            </compilation>
            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
            <authentication mode="Windows" />
            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->


          <pages>
            <controls>
              <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
              <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
          </pages>

          <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
          </httpHandlers>
          <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </httpModules>


        </system.web>

        <system.codedom>
          <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/warnaserror-" warningLevel="4"
                      type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <providerOption name="CompilerVersion" value="v3.5"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" compilerOptions="/optioninfer+"
                      type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <providerOption name="CompilerVersion" value="v3.5"/>
            </compiler>
          </compilers>
        </system.codedom>
       
        <system.web.extensions>
          <scripting>
            <webServices>
              <!--
                  Uncomment this section to enable the authentication service. Include
                 requireSSL="true" if appropriate.
           
              <authenticationService enabled="true" requireSSL = "true|false"/>
              -->
              <!--
                  Uncomment these lines to enable the profile service, and to choose the
                  profile properties that can be retrieved and modified in ASP.NET AJAX
                  applications.
           
               <profileService enabled="true"
                 readAccessProperties="propertyname1,propertyname2"
                 writeAccessProperties="propertyname1,propertyname2" />
              -->
              <!--
                Uncomment this section to enable the role service.        
                <roleService enabled="true"/>
              -->
            </webServices>
            <!--
            <scriptResourceHandler enableCompression="true" enableCaching="true" />
            -->
          </scripting>
        </system.web.extensions>
        <!--
            The system.webServer section is required for running ASP.NET AJAX under Internet
            Information Services 7.0.  It is not necessary for previous version of IIS.
        -->
        <system.webServer>
          <validation validateIntegratedModeConfiguration="false"/>
          <modules>
            <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </modules>
          <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </handlers>
        </system.webServer>


    </configuration>

     

    the IE browser always displays an error  which is as below

    Server Error in '/screenScrap' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

    Source Error:

    Line 27: 
    Line 28:     <appSettings/>
    Line 29:     <connectionStrings/>
    Line 30:     <system.web>
    Line 31:         <!-- 

    Source File: C:\Users\a\Documents\Visual Studio 2008\WebSites\screenScrap\web.config    Line: 29


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

  • Re: where and how should i set the attribute of <location></location>

    03-26-2008, 2:28 PM
    Answer
    • Star
      11,350 point Star
    • Bruce L
    • Member since 02-08-2007, 1:53 PM
    • Posts 1,911

    The root web.config file is set to no allow override on the connectionstrings section. 

    Since your web.config is not trying specify any connection string, you can simply remove this line <connectionStrings/>

    Bruce
    DiscountASP.NET - ASP.NET Hosting Experts
    Voted 2009 "Best ASP.NET Hosting" by asp.netPRO Magazine
    Win2008/IIS7.0, ASP.NET 2.0/3.5 SP1, MVC, AJAX, Silverlight, SQL 2008/2005
  • Re: where and how should i set the attribute of <location></location>

    03-27-2008, 1:37 AM
    • Member
      46 point Member
    • jack2006
    • Member since 12-17-2007, 10:05 AM
    • Posts 102

    what if i want to connect a database whose connectionstring is "Data Source=58.17.30.81;Initial Catalog=a1230192748;Persist Security Info=True;User ID=a1230192748;Password=********"?

  • Re: where and how should i set the attribute of <location></location>

    03-27-2008, 1:44 PM
    • Star
      11,350 point Star
    • Bruce L
    • Member since 02-08-2007, 1:53 PM
    • Posts 1,911

    If that's the case, there 2 options

    1) Configure the connection string in the root web.config

    2) Change the override mode to allow in the connection string node in the web.config.

    Are you the server administrator on the box?  or are you hosting w/ some hoster?   You probably can't do either if you do not have admin privilige on the box.

    Bruce
    DiscountASP.NET - ASP.NET Hosting Experts
    Voted 2009 "Best ASP.NET Hosting" by asp.netPRO Magazine
    Win2008/IIS7.0, ASP.NET 2.0/3.5 SP1, MVC, AJAX, Silverlight, SQL 2008/2005
Page 1 of 1 (4 items)