Publish ASP.NET 2.0 site

E

Eric

I have what is hopefully a quick question. I want to have a quick and
easy method for deploying my website to our test environment. I need
something to do nearly the same thing as the "Publish Web Site" option
under the build menu, except I don't want it to copy over the
web.config file. There are a few settings that need to be different,
so I want the publish process to leave the web.config file alone. What
is the easiest way to do this?

Thanks,
Eric
 
L

Laurent Bugnion

Hi,
I have what is hopefully a quick question. I want to have a quick and
easy method for deploying my website to our test environment. I need
something to do nearly the same thing as the "Publish Web Site" option
under the build menu, except I don't want it to copy over the
web.config file. There are a few settings that need to be different,
so I want the publish process to leave the web.config file alone. What
is the easiest way to do this?

Thanks,
Eric

You could publish to a local filesystem folder, and then FTP everything
to your site except the web.config.

HTH,
Laurent
 
G

Guest

If you store your settings in the <appSettings> section, you can use the
<appSettings file="xxxx"
directive to keep those settings in a separate file, which can be different
for both production and development.
Peter
 
E

Eric

That is basically what I am doing now. For convenience sake I am
wondering if there is a way to remove the second step.
 
E

Eric

I need to change 1 appSetting and 2 connection strings. I'm wondering
now if there is a way to detect a release build. Since publish builds
for release, I could have it use different settings in the web.config
based on that.
 
L

Laurent Bugnion

Hi,
I need to change 1 appSetting and 2 connection strings. I'm wondering
now if there is a way to detect a release build. Since publish builds
for release, I could have it use different settings in the web.config
based on that.

I think it's a possibility.

The compiler variable DEBUG is only defined for Debug build, and is not
defined for release. Additionally, you can use the Configuration manager
in Visual Studio to define more variables if needed.

#if DEBUG
// Use Debug setting
#else
// Use release setting
#endif

You could also test if the Request path is for "localhost" or for
something else, in which case it would be the production server.

HTH,
Laurent
 
E

Eric

Thanks a bunch, I think that will work.

Laurent said:
Hi,


I think it's a possibility.

The compiler variable DEBUG is only defined for Debug build, and is not
defined for release. Additionally, you can use the Configuration manager
in Visual Studio to define more variables if needed.

#if DEBUG
// Use Debug setting
#else
// Use release setting
#endif

You could also test if the Request path is for "localhost" or for
something else, in which case it would be the production server.

HTH,
Laurent




--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top