title: Hosting a .NET 4.0 Web Service in IIS 6
body: <p>I am trying to host a 2nd website (outside of Default Web Site, which is already used) that is a web service supported by .NET 4. This is IIS 6.</p>
  
  <p>The Default web page is using .NET 2.0. In IIS 6 you can have two seperate websites running different versions of .NET by creating two distinct application pools. I've done this.</p>
  
  <p>However I am running into a common problem where the ASP.NET tab does not appear in IIS. That tab allows you to set which version of .NET a site uses.</p>
  
  <p>My workaround is to change the .NET version that each site references through command line:</p>
  
  <pre><code>aspnet_regiis -s (site path)
  </code></pre>
  
  <p>The other solution to this problem is to switch IIS to 64-bit mode, which causes the ASP.NET tab to actually appear. The problem is that switching IIS to 64-bit does not jive well with the existing website, even after reconfiguring IIS to reference the following directory,</p>
  
  <p>Microsoft.NET/Framework64 </p>
  
  <p>as opposed to</p>
  
  <p>Microsoft.NET/Framework </p>
  
  <p>Is anyone experienced with hosting seperate pages on one server like this? This is a nightmare. I can actually get the 2nd page to work, but then the original default page fails, and vice versa. </p>
  
  <p>I now have IIS in 32-bit mode and ran the following from cmd line:</p>
  
  <pre><code>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319&gt;aspnet_regiis -lk
  W3SVC/  2.0.50727.3053
  W3SVC/1/ROOT/   2.0.50727.3053
  W3SVC/87257621/root/    4.0.30319.1
  </code></pre>
  
  <p>Which shows clearly that my 2nd website (which has ID 8725721) is set for .NET 4 whereas the original set (ID 1) is set for .NET 2. They are in seperate application pools. </p>
  
  <p>Under this configuration the initial site works. On the new site I can browse the directory but the .asmx page produces a 404 error. </p>
  
  <p>I have gotten the .asmx page to work as intended, when I enabled IIS for 64-bit mode, but then the default web site gave a 'Service unavailable' generic error because .NET was installed from the Framework path rather than Framework64 path. However even after switching to the Framework64 path more errors came up from the default page. </p>
  
  <p>Also, before I change the target framework of the website Im trying to run to .NET 4, this error shows up in the Event Viewer:</p>
  
  <p>Failed to initialize the AppDomain:/LM/W3SVC/87257621/Root</p>
  
  <p>Exception: System.IO.FileLoadException</p>
  
  <p>Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.</p>