0

i am developing a winform application with VS 2015 professional. i tried to run the application on Win XP, but i have got the message that: *.exe is not a valid Win32 application.

i searched for a solution but i did not find one for c#/winform application. i read the other questions here about this issue, but they solved another project types. only c/c++ projects. like this question for example:

xxxxxx.exe is not a valid Win32 application

any ideas?

Edit 1 i already build it for x86 system but this did not solve the problem.

Edit 2: contains the solution too

i re-install visual studio to get the .Net 4 in the list, as it suggested in the answer below.
the try only to install the .Net 4 without re-installing the visual studio was not possible, even if the list contains "Install Other Frameworks", if one has already a higher version than 4.
so after i uninstall the VS, i deleted all higher version of .Net, and re-install the visual studio and the .Net 4 was listed as in the Screenshot below.

Community
  • 1
  • 1
Orientos
  • 151
  • 3
  • 15
  • You probably built it as a 64bit app – DGibbs Aug 27 '15 at 16:28
  • Still, the same applies for your type of application, seemingly. Explain why that solution won't work for you. Disclaimer: I'm no VS expert, but it seems you've found an answer, but have problems with it. Explaining these problems is obviously a good idea! – Marcus Müller Aug 27 '15 at 16:29

1 Answers1

0

Change the Target Framework in your project properties to 4.0. It is most likely set to 4.5.x or 4.6 which is not supported on Windows XP.

enter image description here

shf301
  • 31,086
  • 2
  • 52
  • 86
  • i dont have the framework 4. i did download it, but when i begin the installation, iget the message that it cant be installed because: the same or higher Version of .NET Framework 4 is already installed on my PC. and it is actually not installed on my PC, so i think because 4.5 is already installed, i can not install the 4 Version. – Orientos Aug 28 '15 at 08:00
  • You have .Net 4 installed on your PC you don't need to install it. All you need to do is go into your Visual Studio project and change it's properties as shown in the screen shot. – shf301 Aug 28 '15 at 11:18
  • In the Combo box where the target framework are listed i don't have the item .NET 4. – Orientos Aug 28 '15 at 22:18
  • Does it list "Install Other Frameworks"? If so use that to install .NET 4. – shf301 Aug 29 '15 at 01:43
  • I cant install it, i have got the message, that the same vor higher version is already installed. – Orientos Aug 29 '15 at 08:11