Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to read web.config file from a different site?

How to read web.config file from a different site?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomtutorialquestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pubududilena
    wrote on last edited by
    #1

    Hi All, We have 2 sites. 1) suppose that one of the 2 sites has been uploaded under following url:- http://www.abc.com/ 2) we need to read above site web.config for our other site which has uploaded in different location. http://www.abctest.com/ How do we read 1) site web.config from second site using c#, asp.net? Thanks in advance.

    A 1 Reply Last reply
    0
    • P pubududilena

      Hi All, We have 2 sites. 1) suppose that one of the 2 sites has been uploaded under following url:- http://www.abc.com/ 2) we need to read above site web.config for our other site which has uploaded in different location. http://www.abctest.com/ How do we read 1) site web.config from second site using c#, asp.net? Thanks in advance.

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Just read the file as XML from the file system path.... :rose::rose:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      G 1 Reply Last reply
      0
      • A Abhishek Sur

        Just read the file as XML from the file system path.... :rose::rose:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        G Offline
        G Offline
        Gaurav Dudeja India
        wrote on last edited by
        #3

        It is not possible to read web.config from one server to another because web.config is assign to each application not to server.

        A 1 Reply Last reply
        0
        • G Gaurav Dudeja India

          It is not possible to read web.config from one server to another because web.config is assign to each application not to server.

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          If it is in another server you need to read it using Unc path.. You cant access Web Config from http requests as they are secure to the web site. Web config is applied to a virtual directory in the IIS. So you can have web.config file for each folder within your project. If not found it applies the parent. :rose:

          Abhishek Sur


          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

          **Don't forget to click "Good Answer" if you like to.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups