Results 1 to 5 of 5

Thread: How to Publish my Application as .exe for 32bit

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    69

    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:
    .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?
    Attached Images Attached Images  

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    69

    Question 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
    Attached Images Attached Images    

  4. #4
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    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.
    Last edited by passel; Sep 12th, 2016 at 12:46 PM.

  5. #5
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    774

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width