Storing <location> Tags in an External Config File

Last post 09-05-2007 2:37 AM by XiaoYong Dai – MSFT. 5 replies.

Sort Posts:

  • Storing <location> Tags in an External Config File

    08-28-2007, 2:17 PM

    In ASP.NET 2.0

    Can you store <location ...> information in an external confi file?  If so, can you supply the markup to point to the external file.  I've tried a number of differnet things but all fail.

    I have a ton of security on my site and my web.config file is getting a little long.

     Thanks in advance,
    MP

  • Re: Storing <location> Tags in an External Config File

    08-29-2007, 12:35 PM
    • Participant
      1,410 point Participant
    • StevenSw
    • Member since 08-19-2002, 8:04 PM
    • Opelika, AL
    • Posts 278
    Steven M. Swafford
    http://radicaldevelopment.net

    Dont forget to click "Mark as Answer" on the post that helped you.
  • Re: Storing <location> Tags in an External Config File

    08-29-2007, 12:55 PM

    stevenSw--

     Thanks for the response.  The article you referenced addresses the appSettings element.  I'm specifically looking for help on storing location elements in an external file.  Unfortunately I had tried the following but this does not  work:

     <location file="externalLocations.config"/>

    ...externalLocations.config...

    <location path="Apps/QA/OCR/UploadScans">
       <
    system.web>
          <
    authorization>
             <
    allow roles="Admin, OCRUploadUser"/>
             <
    deny users="*"/>
          </
    authorization>
       </
    system.web> v</location>
    <
    location path="Apps/QA/OCR">
       <
    system.web>
          <
    authorization>
             <
    allow roles="Admin, OCRAdmin, OCRAnalyst, OCRCoordinator"/>
             <
    deny users="*"/>
          </
    authorization>
       </system.web>
    </
    location>

  • Re: Storing <location> Tags in an External Config File

    08-30-2007, 4:39 AM
    Answer

    Hi

    A "file" attribute is not declared in the scheme of Location. I also found examples on internet written to use an external configuration file but for custom application settings only.

    So, what about creating separate Web.config files for subfolders, Web.config in subfolders will override the settings defined in the Web.config file in the application's root folder.

    http://msdn2.microsoft.com/en-us/library/ms178685.aspx

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Storing <location> Tags in an External Config File

    09-04-2007, 9:26 AM

    I looked at using individual config files for my apps but I have upwards of 40 applications and limited accessability to IIS to configure the folder.  As a result I was looking for an alternate solution.

     Maybe adding the capability to store ANY part of a web site/app configuration in an external config file can be put in a future release???

  • Re: Storing <location> Tags in an External Config File

    09-05-2007, 2:37 AM

    Hi

    Currently, the External config file is able to contain the details of the MyAppSettings custom section.

    You may submit a suggestion to the Visual Studio team and see if it'll be contained in a future release.

    http://connect.microsoft.com/visualstudio

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (6 items)