title: How to replace web.config with transformed for debug file when running WAP in Visual Studio?
body: <p>I want to replace web.config with transformed for debug config file when running in Visual Studio( I am NOT interesting in publishing project to some output directory). I want to keep original web.config in the root of web application in TFS, but on runtime (on IIS or Cassini) I want to use transformed debug version.</p>
  
  <p>The best approach that I found so far (in <a href="https://stackoverflow.com/questions/3922291/use-visual-studio-web-config-transform-for-debugging">Use Visual Studio web.config transform for debugging</a>  and <a href="http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx" rel="nofollow noreferrer">ASP.NET Web Projects: web.debug.config &amp; web.release.config</a> ) is to use web.template.config as a master file, and web.config as derived transformed file.
  I am not fully happy with it, because developers use to consider web.config  as a master file.</p>
  
  <p>I have an idea to output transformed file to ASP.Net temporary files directory, that ASP.NET used for cached files. </p>
  
  <p>Does ASP.NET use web.config file from temporary cache folfder?
  Will ASP.NET allow to have web.config file in cache directory different to web.config  in original folder?</p>
  
  <p>I found a couple properties, related to ASP.Net temporary files directory.
  MSBuild <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.compilationsection.tempdirectory.aspx" rel="nofollow noreferrer">tempDirectory property</a> of the CompilationSection can be used to replace root folder  of ASP.Net temporary files.
  <a href="http://msdn.microsoft.com/en-us/library/system.web.compilation.clientbuildmanager.codegendir%28v=vs.100%29.aspx" rel="nofollow noreferrer">ClientBuildManager.CodeGenDir</a> Property gives access to specific folder where current cache is located.</p>
  
  <p>However I could not find, how to access path of the folder from MSBuild and will it allow me to output transformed web.config to cached folder.</p>
  
  <p>Any suggestions/considerations will be appreciated.</p>