x86 setup for a x64 windows service
I'm trying to get a setup package to run.
If my application and it's setupproject is targeting x32 everything installs fine. But the application fails to load some COM+ components since they are 64bit. If I manually replace the application (after the setup have finished) with a 64bit version everything runs fine.
When I change my app and the setup project to target x64, the setup fails stating: "system.BadImageFormatException: Could not load file or assembly 'C:\xxxxxxx' or one 开发者_StackOverflow社区of it's dependencies. An attempts was made to load an application of incorrect format."
How can I fix this problem?
It sounds like your app is still begin built targeting x86. You can double-check with the Corflags.exe utility. Beware that the Target platform setting is separate for each configuration type. You might have changed it for the Debug configuration, so it runs on your dev machine, but not for the Release configuration, the one you're trying to deploy. Select the configuration first before changing the option. Build + Configuration manager.
Keeping the setup as 64bit but changing application target to "AnyCPU" worked.
精彩评论