Re: Deployment in 2.0 - How To Not Overwrite web.config
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Wed, 2 Nov 2005 19:13:04 -0400
re:
> An "Exclude web.config" checkbox would have been all that was necessary.
Doesn't selecting web.config in the Solution Explorer, and then going to the
menu "Website", and then clicking on "Exclude from project" work for you ?
What I would do, though, is include *all* connection strings in web.config and,
depending on the website's location, use the appropiate one.
Something like (pseudocode ) :
Dim dnsname As String = Request.Url.Host
If dnsname = domain1 Then
' request connection string 1 here
Elseif dnsname = domain2 Then
' request connection string 2 here
Else
' request connection string 3 here
End If
End If
That should take care of all your problems.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Robert" <robertv@xxxxxxxxxxxxxx> wrote in message
news:6C98466E-ACDB-40D2-BFA8-982B4BFA8AC4@xxxxxxxxxxxxxxxx
>I have what I think should be a pretty common scenario in a corporate
> environment. I have a web app and three environments on three servers:
> Development, QA and Production.
>
> We develop in development and then deploy the updated application to our QA
> server and then once tested to our production server.
>
> The application has a web.config file. The contents of the file
> (appsettings part) are different in all three environments because each
> enviroment connects to different databases (a dev, qa and the prod database).
>
> what I'm discovering is that the Publish option in VS2005 won't work in this
> scenario because it will copy web.config from development to QA or production
> and thus result in the incorrect appsettings...i.e. Production all of a
> sudden connecting to the development database.
>
> Is there any way around this with the Publish command? Or do i have to
> manually use "Copy Web" which is more timeconsuming?
>
> Excluding web.config does't work because the web.config in the destination
> is still wiped out. I tried setting web.config to Read ONly in QA and
> production but it is still deleted and overwritten by the one from dev.
>
> Seems like someone really didn't think of this common scenario. An "Exclude
> web.config" checkbox would have been all that was necessary. Or is this
> hidden somewhere?
>
> Thx.
> R-
.
- Prev by Date: Accessing App_Data from App_Code
- Next by Date: Help with a Repeater Issue
- Previous by thread: Accessing App_Data from App_Code
- Next by thread: Re: Deployment in 2.0 - How To Not Overwrite web.config
- Index(es):
Relevant Pages
|