title: Visual Studio 2008 compilation works; Same project compiled in 2010 doesn't
body: <p>Have a project that was created in Visual Studio 2008 and deployed to a 64-bit Windows 2003 server.  This application references a 32-bit Interop.ActiveDs.dll.  The applications were originally compiled for 'Any CPU', however, explicitly compiling as 'x86' doesn't solve the problem.  The project targets the 3.5 framework.</p>
  
  <p>The server is running IIS 6.0 in 64-bit mode.  When we deploy the version compiled in Visual Studio 2008, the app runs perfectly fine; all pages show up.  In retrospect, this is actually surprising.</p>
  
  <p>We migrated the application to Visual Studio 2010 (we did not change the targeted framework) and redeployed.  Now we get a BadImageFormatException loading Interop.ActiveDs.dll.  Which actually makes more sense than the 2008 version running.</p>
  
  <p>To solve the problem, we set Enable32bitAppOnWin64 to true and ran aspnet_regiis.exe -i from the 32-bit folder of the 2.0 framework (as per various instructions on the web).  In IIS, web service extensions, there were two versions of ASP.NET 2.0, one for 32-bit and one for 64-bit.  We prohibited the 64-bit version, restarted IIS, and launched the website.</p>
  
  <p>What we expected:  The app to run as 32-bit, load the interop, and display<br />
  What we got:  "Service Unavailable"</p>
  
  <p>All other web pages that were previously working displayed the same message, as did the Visual Studio 2008 version.</p>
  
  <p>The support page <a href="http://support.microsoft.com/kb/894435" rel="nofollow">here</a> describes the problem exactly, but tells us to do exactly what we did to resolve the problem (enable 32-bit mode).</p>
  
  <p>We've rolled back to 64-bit mode in IIS and deployed the Visual Studio 2008 version for now, but we really need to figure out how to make this app run and load the interop (there are also 32-bit Oracle DLLs that are referenced)</p>
  
  <p>Two questions:<br /></p>
  
  <ol>
  <li>Why does the Visual Studio 2008 version work at all??<br /></li>
  <li>How do we get the Visual Studio 2010 version to work?  And what is 2010 doing differently that causes the issue?</li>
  </ol>
  
  <p>Thanks in advance!<br />
  James</p>