King Chan
King Chan

Reputation: 4302

Does Visual Studio 2008 has Web.config.Debug and Web.Config.Release for ASP.NET?

As titled, does it? I am pretty sure I saw it in Visual Studio 2010. (I don't have Visual Studio 2010 in the office...)

I want to have debug mode use debug server connection string etc.

If not, any workaround?

Upvotes: 3

Views: 1071

Answers (1)

Andrew Barber
Andrew Barber

Reputation: 40150

Visual Studio 2010 has web.config transforms, which use web.debug.config and web.release.config files to apply transformations to the original web.config. It actually uses whatever the current build configuration name is; Debug and Release are the defaults, of course.

One important note is that this is a Visual Studio feature, not an IIS feature. IIS won't pay any attention to a web.[anything].config file; only the real one.

Also, the transforms are not used while running the web application within Visual Studio: Transforms are applied during building a deployment package, and the output web.config has the proper transforms applied.

MSDN: How to: Transform Web.config When Deploying a Web Application Project

Upvotes: 4

Related Questions