[英]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. 我的应用程序(C ++,非托管)有一个写为C#应用程序的功能。 This feature is only available when we know .NET is installed. 此功能仅在我们知道安装了.NET时才可用。 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)? 因此,我必须为我们想要支持的每个框架版本维护这个C#应用程序的单独版本,或者是.NET 2.0的最低通用分母(因此,如果我们检测到任何安装的框架> = 2.0,我们知道我们将好吗)?
Note that I prefer to just maintain a single .NET 2.0 version of our C# app. 请注意,我更喜欢只维护一个.NET 2.0版本的C#app。
You can assume that .net 2.0 apps will run on the 4.0 runtime. 您可以假设.net 2.0应用程序将在4.0运行时运行。
See: http://msdn.microsoft.com/en-us/library/ff602939.aspx 请参阅: http : //msdn.microsoft.com/en-us/library/ff602939.aspx
是的,如果您针对.Net 2.0编写和构建应用程序,它将适用于所有版本。
The .NET framework dependencies page for .NET 4 on MSDN says that yes, you can count on it: MSDN上.NET 4的.NET框架依赖页面说是的,你可以指望它:
You do not have to install previous versions of the .NET Framework or the CLR before you install the latest version; 在安装最新版本之前,您不必安装以前版本的.NET Framework或CLR; each version provides the necessary components. 每个版本都提供必要的组件。
是的...(.net 2将在.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. 我遇到了像SharpSvn这样需要CLR v.2运行的混合模式程序集的问题,而我的应用程序是为.NET 4编译的,所以我们必须安装这两个版本的框架。 Still I believe it's not your case. 我仍然认为这不是你的情况。
是的,它确保了后兼容性,我用.net 3和3.5sp1做了这个,他们目前在.net 4上运行没有任何问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.