How do I force MSBuild to compile for 32-bit mode?

According to MSDN, you're doing the right thing. Looks like /p:Platform=x86, but actually, maybe it's /p:PlatformTarget=x86.

Try to just invoke MSBuild directly with that parameter (make sure it's not an issue with your NAnt file. Look at the build output for the right build configuration (Debug / Release).


If the assemblies themselves are always going to be 32 bit, why not add the setting to the .vbproj file? That will take MSBuild out of the equation.

Just add the following line to the initial PropertyGroup in the .vbproj file

<PlatformTarget>x86</PlatformTarget>