title: VS2012 WebDeploy Publish Breaking Web.Config
body: <p>I have a MVC3 Web Application project that I develop and publish from Visual Studio 2012.  This was recently a VS2010 project that was migrated.</p>
  
  <p>My web.config is setup using a <code>&lt;location inheritInChildApplications="false"&gt;</code> tag so that a child application running in a virtual directory does not take on the settings.</p>
  
  <p>I have setup a WebDeploy publish profile, which worked flawlessly in VS2010, but breaks my application when published from VS2012. It adds a <code>&lt;connectionStrings&gt;</code> node after the closing aforementioned <code>&lt;/location&gt;</code> tag, even though I already have a <code>&lt;connectionStrings&gt;</code> node inside my <code>&lt;location&gt;</code> node.  This breaks the app due to an invalid configuration file.</p>
  
  <p>I've tried re-creating the profile from scratch which didn't solve the problem.</p>
  
  <p>Based on what I have read here, <a href="http://msdn.microsoft.com/en-us/library/dd465337.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd465337.aspx</a>, unchecking the "<code>Use this connection string at runtime</code>" checkbox should instruct the publish process to <strong>NOT</strong> add the connection string, but it does anyway.</p>
  
  <p>I'm thinking that this would not be an issue if I wasn't using the <code>&lt;location inheritInChildApplications="false"&gt;</code>, because the connection string would get added to the right spot.</p>
  
  <p>Also, note that if I publish to the File System instead of using WebDeploy, the published Web.Config is created correctly and does NOT have the extra connection string node added.</p>
  
  <p>Are there any known workarounds for this issue?</p>