I used VS2010, and target for .Net 2.0 (VB.Net Windows Form application)
How to decide what is the .Net target I decided on 2.0 because I understood it will be OK if the users have higher version
I tested my app on XP with .Net 2.0, works fine.
I uninstalled .Net 2.0 [to see what error message users might get]
[a few files were still left in C:\Windows\Microsoft.Net\Framework\v2.0.50727 but not all files]
I installed .Net 4 [. . . also needed to install Windows Installer 3.1, and Windows Imaging Component, as pre-requirments . . .]
but now when I run my app I get the error - "unable to find a version of the runtime to run this application"
so what should I recomend my clients? to install 2.0?
Thanks,
Atara
Update: I am going to recommend my XP users to install .Net 3.5 SP1
Here's a brief overview of which framework is required on select windows OSes [which in my opinion are more commonly encountered].
As you can see, Microsoft has the frameworks that were already released as of when an OS was being released preinstalled.
It is also worth noting that when you install .NET 3.5 sp1, you automatically get 3.0 and 2.0 installed. This is because they all run on the same underlying framework and each version builds on the previous.
.NET 4 is a completely different animal. It runs on a different underlying framework so you don't automatically get the older versions of the .NET framework when you install it.
Hope this helps.
You should build an installer (a Setup/Deployment project in Visual Studio) that includes the 2.0 redistributable so that when your clients install your software it will install the necessary .net framework for it to run.
The moment is build the project, try to access its properties and change the "Target Framework". And select the framework that your clients have. This may solve your problem.
Just because you installed .NET 4.0 doesn't mean your application was targeting .NET 4.0.
If you modify your project settings in Visual Studio to build to target .NET 4.0 and you should no longer get the error (but then your clients will need to install the .NET 4.0 Runtime).
Personally, if you want to release something that is going to run on the majority of client machines already out there, I would target .NET 3.5. Most people are going to have the runtime installed already.
If not, it's easy enough to download from Microsoft.
.
You have two choices:
A .NET 2.0 application needs .NET 2.0 to run. A .NET 3.0 or 3.5 application only needs .NET 2.0 plus whatever additional .NEt 3.0/3.5 assemblies it actually uses.
A .NET 4.0 application needs the .NET 4.0 CLR, so .NET 4.0 must be installed.