简体   繁体   English

如果我知道.NET 4.0安装在用户的机器上,我可以假设.NET 2.0也是如此吗?

[英]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.

相关问题 我可以在.NET 2.0上使用.NET 4.0 API调用吗? - Can I use .NET 4.0 API calls on .NET 2.0? 如何检查机器上安装的.Net Framework 4.8 - How can I check .Net Framework 4.8 Installed on machine 我可以托管带有.NET 4.0应用程序池的.NET 2.0运行Web应用程序吗 - Can I Host .NET 2.0 Running Web Application with .NET 4.0 App Pool 如何从用户的计算机获取有用的WPF .NET错误信息? - How can I get useful WPF .NET error information from a user's machine? 我可以在安装了 .net 4.7 的机器上运行 .net 4.7.2 目标应用程序吗? - Can I run .net 4.7.2 targeted application on machine which has .net 4.7 installed? NUnit 与 .NET 4.0 而不是 .NET-1.1 / .NET-2.0。 我需要的 DLL 在哪里? - NUnit with .NET 4.0 rather than .NET-1.1 / .NET-2.0. Where is the DLL I need? 使用.net 4.0编写的程序,但我需要此应用程序在运行.net 2.0的计算机上运行 - Program written using .net 4.0 but I need this application to run on computers running .net 2.0 在.net 2.0上构建的exe可以引用在.net 4.0上构建的dll吗? - Can an exe built on .net 2.0 refer to a dll built on .Net 4.0 WCF服务(.NET 4.0)可以具有.NET 2.0客户端吗? - WCF service (.NET 4.0) can have a .NET 2.0 client? 如何确定是否安装了 .Net 5 运行时? - How can I determine if the .Net 5 runtime is installed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM