title: IIS doesn't correctly substitute "~" in VS2012 ASP.NET web site
body: <p>I have my ASP.NET site generated from Web Forms template in Visual Studio 2012. I have this code in the master page:</p>
  
  <pre><code>&lt;asp:PlaceHolder runat="server"&gt;
      &lt;%: Styles.Render("~/Content/themes/base/css", "~/Content/css") %&gt;
      &lt;%: Scripts.Render("~/bundles/modernizr") %&gt;
  &lt;/asp:PlaceHolder&gt;
  </code></pre>
  
  <p>When I run my site from VS, all works fine. When I deploy it to the server, css files cannot be loaded because the above code resolves as </p>
  
  <pre><code>&lt;link href="/Content/themes/base/css?v=UM624qf1uFt8dYtiIV9PCmYhsyeewBIwY4Ob0i8OdW81" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/Content/css?v=tMLDfv3u-lElLSOX_gsfU7tfsfKPoY_vJBePC7KLa6U1" rel="stylesheet" type="text/css" /&gt;
  &lt;script src="/bundles/modernizr?v=EuTZa4MRY0ZqCYpBXj_MhJfFJU2QBDf0xGrV_p1fHME1" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>All the paths are counted from the domain's root, while my site is deployed under a subfolder, like <code>http://MyDomain.com/MySyte/</code>. Obviously, the tilde operator <code>~</code> is not handled right. In all other places, like hrefs, it is properly replaced and navigation works fine in deployed site.</p>
  
  <p>Another example. For this code from master page</p>
  
  <pre><code>&lt;asp:ScriptManager runat="server" AjaxFrameworkMode="Explicit"&gt;
      &lt;Scripts&gt;
          &lt;asp:ScriptReference Name="MsAjaxBundle" /&gt;
          &lt;asp:ScriptReference Name="jquery" /&gt;
          ...
      &lt;/Scripts&gt;
  &lt;/asp:ScriptManager&gt;
  </code></pre>
  
  <p>I have this html output</p>
  
  <pre><code>&lt;script src="/bundles/MsAjaxJs?v=eYkLZimNY09iWQvWpdPDkxCLGwdMBLWkJ4bU5r3y6GU1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>So the path to jquery is proper and relative, while MsAjaxBundle resulted in some absolute path.</p>
  
  <p>I consider this behavior being a bug. How can I workaround it?</p>
  
  <p><strong>Update:</strong></p>
  
  <ul>
  <li>Windows 7 x64 </li>
  <li>IIS 7.5 </li>
  <li>ASP.NET Application Target Framework 4.5 </li>
  <li>IIS Application Pool Framework 4.0</li>
  </ul>