Search code examples
visual-studio-200564-bitcom-interopvs-web-site-projectvs-web-application-project

How to set platform target for a ASP.NET "web site" project


I keep running into all sorts of nuances between the "web site project" versus "web application project" - here is the latest for me:

I've inherited a Visual Studio 2005 solution with several class library projects (a DAL.dll, a Biz.dll, etc.) but this is all "fronted" by a web site project rather than a web app project.

While the web app project provides a Platform Target dropdown list (Any CPU, x86, x64), the poor web site project appears to offer nothing like that. Is there a way to ensure the web site runs as x86 when hosted on a 64bit IIS machine?

..The bigger picture of why I am asking this:

The website runs on a 64bit machine (Win Server 2003) and [I have just learned] cannot load a 32bit COM object which I believe has been wrapped with a Runtime Callable Wrapper. Because it cannot load this piece, a web.config setting is set to avoid the runtime load error by bypassing the load of this 32bit dll (but all of the functionality of COM dll is therefore "lost" when the site is running on a 64 bit machine).

So, in summary, I presume the web site on the 64bit machine must be running in IIS as a 64bit app and that if I could just get the site to run as 32bit instead, then it could load the COM dll and therefore execute that functionality of the application.

NOTE: I have been and still am doing research here in preparation for a quick uptake when I get access to the actual development environment so much of my question is based on piecing together parts of my [anticipated] problems to be faced soon. Thanks.


Solution

  • As far as im aware, under server 03 you cant have 64 bit and 32 bit application pools in IIS side by side.

    You can force it run in 32bit mode but this would affect all application pools, and therefore all sites / apps. This sounds like it should fix your COM issue but it might have an effect on any thing else running on that box so be aware of that. To be fair the chances of switching from 64 bit down to 32 effecting things are less than vice versa. The only common thing that springs to mind that must be ran in a 64 bit applicaiton pool is Exchange 07. Having said that im a dev, not a server admin.

    If your sure, look here

    Btw, server 08 can rock both 64 bit and 32 bit app pools simultaneously.