Different settings in web.config, based on host

Discussion in 'ASP .Net' started by Daves, Jun 8, 2005.

  1. Daves

    Daves Guest

    since I have some settings different on my local host (where I develop) and
    my ISP's (where I upload my final developments) I need different settings in
    my web.config. For example the dbase connection strings are different and
    then I want to have debug=true locally but not on ISP host.

    How would you solve this, can I programmatically set which web.config file
    to use eg. in global.aspx depending on server name?
     
    Daves, Jun 8, 2005
    #1
    1. Advertising

  2. Daves

    Phillip Ian Guest

    I simply don't copy the web.config file when I deploy. Of course, if I
    make changes that need to be in both, I have to make them twice. But
    really, how often do you change the web.config anyway?

    Of course, if you're using a deploy project, I'm not sure if that's
    possible.
     
    Phillip Ian, Jun 8, 2005
    #2
    1. Advertising

  3. Daves

    Daves Guest

    probably you're right; do-not-copy, just thought maybe there was some pro
    way of doing this. BTW, what exactly is a "deploy-project" ?



    "Phillip Ian" <> wrote in message
    news:...
    >I simply don't copy the web.config file when I deploy. Of course, if I
    > make changes that need to be in both, I have to make them twice. But
    > really, how often do you change the web.config anyway?
    >
    > Of course, if you're using a deploy project, I'm not sure if that's
    > possible.
    >
     
    Daves, Jun 8, 2005
    #3
  4. Daves

    Phillip Ian Guest

    I'm not ruling out some fancy way of doing it mind you...I've never
    claimed to be a pro. :)

    I was referring to the Setup Project type in VS. Packages up your
    program or site for deployment. I've never used them for web
    apps...only Windows.
     
    Phillip Ian, Jun 8, 2005
    #4
  5. Daves

    KMA Guest

    There is a way to add an "include" to the web.config.

    The included file contains all the information that is site specific
    information. That way you can still copy the web.config. The downside is
    that if you change the site specific stuff you have to propagate a reload of
    your app otherwise it won't be picked up, whereas simply saving web.config
    would make changes immediately.

    "Phillip Ian" <> wrote in message
    news:...
    > I'm not ruling out some fancy way of doing it mind you...I've never
    > claimed to be a pro. :)
    >
    > I was referring to the Setup Project type in VS. Packages up your
    > program or site for deployment. I've never used them for web
    > apps...only Windows.
    >
     
    KMA, Jun 9, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=

    Web.Config Get Config settings at runtime.

    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,297
    Kevin Spencer
    Feb 6, 2004
  2. CSharpner
    Replies:
    0
    Views:
    1,111
    CSharpner
    Apr 9, 2007
  3. leeanne
    Replies:
    0
    Views:
    1,916
    leeanne
    Sep 24, 2008
  4. donet programmer
    Replies:
    3
    Views:
    1,622
    Gregory A. Beamer
    Nov 20, 2009
  5. Guest
    Replies:
    2
    Views:
    196
    Foo Man Chew
    Dec 29, 2003
Loading...

Share This Page