CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Posts
    11

    Question Web.config changes after deployment?

    Ok, Im having some problems with a simple web app hosted on a server with SQL Server installed. I believe the proper term is my project is "Remotely Deployed". Anyways...

    After I deploy the web app (using a proper deploy project), the Web.config file has an app settings section for such things as ado connection strings:
    [add key="some sql connection object" value="connection string blah blah"]

    where "connection string blah blah" is some sort of dynamic string to use for my sql connection object.

    Now my question!!
    --> Can this string be modified on the server it was installed to AFTER DEPLOYMENT?

    (I am getting tired of re-compiling my project and going to the server, installing again, just to find a connection string that works!!)

    I appreciate any knowledge here, john.

  2. #2
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    173
    Your connection string can be changed in code; however, why not just leave your web.config file on the server alone once you have it set up the way you want?

    You could also keep your connection settings in a separate xml file and have them loaded into application global cache when the file changes.

    pjp
    Preston Park
    CTT+, MCT, MCSD
    http://www.prestonpark.com/

  3. #3
    Join Date
    Jun 2002
    Posts
    11
    Isn't the Web.config file XML as well? If it is, then a seperate XML file would be redundant for loading.

    As for why I shouldnt leave it alone, well, if the database server gets switched to another machine, then I think that my question has some validity (and I know it will because the current DB is just a substitute until business gets settled.

    I guess i will just test it out monday, but i thought maybe someone had tried it already.

    - john

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured