3

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?

King Chan
  • 4,212
  • 10
  • 46
  • 78

1 Answers1

4

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

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
  • +1 Thanks, didn't know it called Web.config transformation and works in that way. Now I could able to find solution: http://stackoverflow.com/questions/4024401/web-config-transformations-in-vs2008 – King Chan Feb 09 '12 at 19:57