JohnySiwus
JohnySiwus

Reputation: 3

Different endpoint address in Web.Release.config

like in the title. I want to have different endpoint address while build in release mode, how to achieve this?

Upvotes: 0

Views: 271

Answers (2)

RB.
RB.

Reputation: 37212

In Visual Studio 2010 you can create configuration transformations. Essentially you create a file called Web.Release.Config and the contents of this will be merged into the web.config when you build in Release configuration. See here for example use, but it's widely documented on the web.

In Visual Studio 2008 and earlier (where the transformation feature is not available), we have successfully used T4 templating to generate our web.config at build-time. We generate multiple configurations (one per environment) and to do this I suggest reviewing Oleg Sych's blog, who details how to generate multiple configuration files from a single T4 template.

However, if you only want to modify a small part of the configuration (which it sounds like you do) then you can probably use a straightforward T4 file web.config.tt to generate your configuration - our needs were somewhat more complex!

Upvotes: 1

faester
faester

Reputation: 15086

In most cases web-config transformations would be the best choice compared to T4 for this instance.

I have grown very fond of the Slow Cheetah plugin, which enables you to preview transformations in a diff-view:

Upvotes: 0

Related Questions