If I know .NET 4.0 is installed on a user's machine, can I assume .NET 2.0 is as well?
Pretty self-explanatory question, but here's a bit of context:
My app (C++, unmanaged) has a feature written as a C# app. This feature is only available when we know .NET is installed. So, must I maintain separate versions of this C# application for each framework version we want to support, or will a lowest-common-denominator of .NET 2.0 work (thus, if we detect any framework installed >= 2.0, we know we will be OK)?
Note that I prefer to just maintain a single .NET 2.0 version of our C# a开发者_开发问答pp.
You can assume that .net 2.0 apps will run on the 4.0 runtime.
See: http://msdn.microsoft.com/en-us/library/ff602939.aspx
The .NET framework dependencies page for .NET 4 on MSDN says that yes, you can count on it:
You do not have to install previous versions of the .NET Framework or the CLR before you install the latest version; each version provides the necessary components.
Yes, if you write and build your application against .Net 2.0, it will work with all versions going forward.
Yes... (.net 2 will work on .net 4)
I met a problem with mixed-mode assemblies like SharpSvn, which needed CLR v.2 to run, while my app was compiled for .NET 4, so we had to install both versions of the framework. Still I believe it's not your case.
yes it has back compatibility assured , i have done this with .net 3 & 3.5sp1 and they are currently running on .net 4 without any problem.
精彩评论