I have a program that requires both x64 and x86 dlls (it figures out which ones it needs at run time), but when trying to create a setup, it complains:
File AlphaVSS.WinXP.x64.dll' targeting 'AMD64' is not compatible with th project's target platform 'x86'
File AlphaVSS.Win2003.x64.dll' targeting 'AMD64' is not compatible with th project's target platform 'x86'
File AlphaVSS.Win2008.x64.dll' targeting 'AMD64' is not compatible with th project's target platform 'x86'
How can I make my setup target both platforms like my program does?
So, target x86 or x64. Since x86 apps run on both x64 and x86 systems, the most compatible choice is to build x86. If you MUST build a 64 bit solution, you'll need to target x64 and use our x64 dlls.
To enable x64 as a CPU platform targetClick Configuration Manager. In the Configuration Manager dialog, open the Active solution platform drop-down list box and click <New> …. In the New Solution Platform dialog, select x64 in the Type or select the new platform drop-down list box.
The Win32 platform name is used for C++ projects, and it means x86. Visual Studio considers both project-level platforms and solution-level platforms, and the project platforms come from the language-specific project systems. C++ projects use Win32 and x64, but the solution platforms use x86 and x64.
Open the 32-bit project in Visual Studio 2008. In the file menu, click Build and select Configuration Manager. Pull down the drop-down under “Active solution platform” which currently displays “Win32” and select New. In the drop-down for “Type or select the new platform”, select “x64”.
The MSI created by the setup project (in Visual Studio) can only target one platform at a time. Your option is to either make 2 MSI's, merge them together and make a custom setup boot strapper that choose between the two. There are some 3rd party products,like Advanced Installer for example, that can do this for you.
I ran into this too and wrote a blog post about my solution:
The deflate.exe
file can be downloaded from its repository on google code.
.Net has an "Any CPU" option. It's tempting to think of it as more of a "generic" option that's going to only use the lesser x86 features, but really it lets the JIT compiler on each machine pick the appropriate cpu type for that machine.
The only time you shouldn't use it is if you know you have dependencies or requirements that aren't good for one architecture or the other. For example: you know you need a lot of ram, you have a dependancy on a 32-bit native dll, or you want to pre-compile the app.
There's a danger here because you have a platform-specific dll dependancy. But you have dlls for both types and it sounds like you know how to pick the right one at runtime. So will the 'Any CPU' option work for you?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With