views:

165

answers:

3

We have a MVC application that depends on a number of 3rd party products (e.g., Crystal, Topaz). The Topaz signature device only has 32-bit .dlls available. So I'm assume that I need to build and deploy the app on IIS 7 in an a 32-bit App Pool.

If that assumption is correct, then do I need to build the MVC app with the VS2008 compiler setting to "x86" (right now I'm using "Any CPU"?

Also, do all the referenced assemblies need to be 32-bit as well? If so, how do I get 32-bit MVC files onto a x64 Server 2008?

Finally, how do I make the inetpub/ directories x86 friendly, or does that magically happen as a consequence of something else?

A: 

Hey Dale,

Does it matter if your MVC app runs as 32-Bit? Or do you have a compelling reason to try to go to 64-Bit?

If you can live with 32-bit, complile all of your assemblies as x86. When you configure IIS on your x64 server 2008, make sure to update the "Advanced Settings" on your app pool -set "Enable 32-Bit Applactions" to true.

Patrick

Patrick
A: 

If that assumption is correct, then do I need to build the MVC app with the VS2008 compiler setting to "x86" (right now I'm using "Any CPU"?

Yes, entirely correct.

Also, do all the referenced assemblies need to be 32-bit as well? If so, how do I get 32-bit MVC files onto a x64 Server 2008?

No need, if those assemblies are built as ANY CPU, then the .Net framework will resolve it to 32 bit, as long as your entry assembly is 32 bit.

Finally, how do I make the inetpub/ directories x86 friendly, or does that magically happen as a consequence of something else?

It just happens magically.

Ngu Soon Hui
A: 

If that assumption is correct, then do I need to build the MVC app with the VS2008 compiler setting to "x86" (right now I'm using "Any CPU"?

you can set it to any CPU and it will run on 32 bit or 64 bit, depending on your app pool settings and as long as your other dependent dlls are also compiled with "any CPU"

Also, do all the referenced assemblies need to be 32-bit as well? If so, how do I get 32-bit MVC files onto a x64 Server 2008?

If you are using unmanaged code (or reference assemblies) you need to get the specific 32 bit and 64 bit version of that assembly.If you have 32 bit assemblies and if you enable 32 bit applications in your app pool, they would be run in WoW64 mode

another reference: http://blogs.msdn.com/gauravseth/archive/2006/03/07/545104.aspx

If you have x64 version,they would be run natively as 64 bit

The Topaz signature device only has 32-bit .dlls available. So I'm assume that I need to build and deploy the app on IIS 7 in an a 32-bit App Pool.

How did you verify it? Did you use Corflags.exe ? You can know more about it here. Regardless of your PE header (PE32 or PE32+) if your 32BIT is set to 0, you can run it on a 64 bit app pool.Even if it is set to 1 and if it is not signed, you can set it to 0 (but might not be worth taking the risk) and run it on 64 bit app pool

ram
Thanks Ram. R U saying that even if I compiled my app for x86, but had the Microsoft x64-bit MVCx.dlls installed on the server, that somehow my 32-bit app dll will happily find and use the 64-bit Microsoft DLLs?
Dale
nope. If the app is compiled as x86 and if the reference is either x86 or any CPU, you are fine. But if the reference is x64, you are in trouble. I recommend you check the headers using corflags.exe
ram
on the other hand ,if all your references are managed code (with ANY CPU) /set to 64 bit, you need not enable the "32 bit app" in application pool.You will get the benefit of 64 bit right away without any tweaks
ram