1 Attachment(s)
How to Publish my Application as .exe for 32bit
Good day everyone,
I was watching this Youtube tutorial on how to Publish your Project as .exe
https://www.youtube.com/watch?v=iAv-vfTEyiM
I was able to publish my project successfully and run it on 64bit computer.
But when running on 32bit computer, the exe gave the error:
Quote:
.exe is Not a Valid Win32 Application
My assumption is that my published program is in 64bit, hence not supported in 32bit.
Either that or I might missed out something else.
In the pre-requisites, the video ask to uncheck the "Create setup program..."
How should I publish it to work for 64bit and 32bit?
Re: How to Publish my Application as .exe for 32bit
This really has nothing to do with publishing. The publishing process will just publish whatever you've already built. It's the build process that creates a 32-bit or 64-bit EXE. You should find the appropriate options under the Compile page of the project properties. There you can set the Target CPU. x86 means that your EXE will run in a 32-bit process on all systems while x64 means your EXE will run in a 64-bit process, thus it won't run on 32-bit machines. 'Any CPU' means that it will run in a 32-bit process on 32-bit machines and in a 64-bit process on 64-bit machines, although you can also check the 'Prefer 32-bit' box to change that behaviour. To be honest, I'm not sure what the difference is between 'Any CPU' couple with 'Prefer 32-bit' and just selecting x86. Presumably there's some but it's never been important enough for me to research further. So, as long as your Target CPU is not set to x64, you should be fine on all systems.
3 Attachment(s)
Re: How to Publish my Application as .exe for 32bit
Hi,
I have switched my Compile to 32bit.
However it still gives the same error.
The PC that I require to run it on is Windows XP pro SP3 32bit
Re: How to Publish my Application as .exe for 32bit
Seems like you aren't generating a 32-bit compatible application.
At the top of your first image, the platform still says "AnyCPU" is still the active platform for building (technically seems that should have worked). I would try changing that to x86.
And then make sure you are choosing the correct executable. The executable will be generated in a different branch of the tree under the bin directory, i.e instead of in bin/debug it will be in bin/x86/debug perhaps.
Re: How to Publish my Application as .exe for 32bit
Although it does still look like a 32/64 bit issue, I think you will find that .NET 4.5 is not supported by XP SP3. You can't target anything later than .NET 4.