1

I have a C# application and the target framework was 2.0. The app runs fine on Windows 7 and vista without asking users to install any framework.

Since the coming of windows 8 the app does not run anymore. When it runs on the vanilla version of windows 8 the OS gives a message that app requires framework 3.5 and asks them to install it.

My assumption was since Windows 8 comes with framework 4.5 and it should support older api's why should users be forced to install framework 3.5 ?

Should I change the target of my application to be 4.5 ? and if I do so, will the app still run on windows 7 (vanilla) without asking users to have 4.5/4.0 framework ?

Please advise, I want the app to be able to run on multiple frameworks at least 3.5 and 4.0/5 (on vista, windows 7 and 8) without asking them to install frameworks

Thanks

Ahmed
  • 14,503
  • 22
  • 92
  • 150
  • Windows 8 comes with .NET 4 and 4.5, but not with 3.5 or lower. If you do not want to ask the user to install the correct framework, then you **must** perform the installation yourself. I remember having to do something similar, and here's one thing you must know about installing 3.5 on Windows 8: You cannot do it silently or automatically on Windows 8. You can package the installer (full or web-install) and run it, but Windows 8 will not run those; instead it will ask the user if they want to install 3.5 (the user may refuse), then perform the installation itself. – Nolonar Jul 06 '13 at 22:24
  • 2
    What exactly is wrong with the user clicking "Yes, please"? You can tell the CLR that you tested your app against 4.5 by including an [app.exe.config file](http://stackoverflow.com/questions/4652167/net-any-framework-configuration/4652331#4652331) – Hans Passant Jul 06 '13 at 22:25

1 Answers1

1

Windows is not a distribution platform for the .NET framework, that is Microsoft's official guidance. Just because Windows 7 may ship with .NET 3.5 installed by default does not mean that it will be there (it can be removed). Ditto with Windows 8 and .NET 4.5, you are required to supply the redistributable with your application installer. Just like you are required to do so with Visual C++ when compiling C/C++ applications.

That said you can force a 3.5 app to run in 4.0, I would highly recommend not doing it though unless you're going to do extensive QA for both.

How to force .NET 3.5 application run on .NET 4.5 runtime?

Community
  • 1
  • 1
Mgetz
  • 5,108
  • 2
  • 33
  • 51