0

I have winforms applicaton. I created a setup using click once. My applicaton is build in .NET 4.0 and x86 as platform target. It works on my .NET 4.5 Win 7 64 bit machine but on a .NET 4.0 64 bit Win Server 2003 machine it gives the exception setup.exe is not a valid win32 application. I can only run the application via copying all the related files.

What may be the problem?

gesus
  • 471
  • 1
  • 10
  • 24
  • you may need app.config file: http://stackoverflow.com/questions/4586210/how-do-i-compile-my-app-config-into-my-exe-in-a-vs2010-c-sharp-console-app – fatihk Jun 25 '13 at 11:43
  • What will app.config file do? – gesus Jun 25 '13 at 11:58
  • Your program is marked as not compatible with XP and Windows 2003. A feature of .NET 4.5, it doesn't have to support them anymore because 4.5 is not available on those old versions of Windows. So there's something wrong with the assumption that you targeted .NET 4.0. You didn't leave enough details to guess how that could have happened. Diagnose it with `dumpbin.exe /headers setup.exe`, the important one is "subsystem version", a value of 6.00 is the problem. – Hans Passant Jun 25 '13 at 16:45
  • When i setup the program on windows 7 and carry the output from `AppData/Local/Apps` to the target Win Server 2003 computer it works. The problem is about the setup project i guess. how can i set the .NET version of the setup project? – gesus Jun 26 '13 at 08:21

1 Answers1

1

I removed the tick under "properties->publish->Prerequisities->Create setup program to install prerequisite components" and now it's working.

gesus
  • 471
  • 1
  • 10
  • 24