.NET Framework构建版本与已安装版本 [英] .NET Framework Build Version vs Installed Version

查看:122
本文介绍了.NET Framework构建版本与已安装版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果应用程序是为.NET Framework X版本构建的,则版本Y安装在运行它的框中(其中Y> X),这意味着什么(除了它是"兼容的")? 
如果版本X中有一个在Y中修复的错误,应用程序是否会使用该错误或修复? 换句话说,当为X版构建应用程序时,版本Y是否像版本X一样运行(包括版本X中在Y中修复
的任何错误)? 另一方面,如果Y中存在不在X中的错误,应用程序是否会遇到该错误?

解决方案

Hi uncaged,


欢迎来到MSDN论坛。



  • 如果应用程序是为.NET Framework版本构建的X和版本Y安装在正在运行的盒子上(其中Y> X),这意味着什么(其他
    比它的"兼容")? 

除了兼容性,
。NET 4.x应用程序在同一个CLR上运行,因此可以使用其中的任何内容。如果您需要特定版本的框架(而不是CLR),那么
您必须检测到这一点在安装时。这是大多数安装程序所做的。在运行时,所有.NET 4.x应用程序都运行在相同的CLR版本
..NET Framework版本2.0,3.0和3.5使用相同的方式构建版本的CLR(CLR 2.0)。更多信息
参考:


BTW。 您不应卸载计算机上安装的任何.NET Framework版本
,因为您使用的应用程序可能依赖于特定版本,如果删除该版本,可能会中断。
 
可以加载多个版本的.NET Framework一台计算机同时使用。
 


最好的问候


月的


If an application was built for .NET Framework version X, and version Y is installed on a box where it's running (where Y > X), what does that mean (other than that it's "compatible")?  If there was a bug in version X that was fixed in Y, will the application be working with that bug or with the fix?  In other words, does version Y run like version X when an application was built for version X (including any bug in version X that was fixed in Y)?  On the flip side, if there's a bug in Y that wasn't in X, will the application be experiencing that bug?

解决方案

Hi Uncaged,

Welcome to the MSDN forum.

  • If an application was built for .NET Framework version X, and version Y is installed on a box where it's running (where Y > X), what does that mean (other than that it's "compatible")? 

In addition to compatibility, .NET 4.x apps run on the same CLR and therefore can use whatever is there.  If you need a specific version of the framework (not the CLR) then you have to detect this at install time.  That is what most setup programs do. At runtime all .NET 4.x apps run on the same CLR version. The .NET Framework versions 2.0, 3.0, and 3.5 are built with the same version of the CLR (CLR 2.0). more info to refer: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies .

  • What do you mean the "bug"? if you meet any error prompt during running app?

Firstly, The .NET Framework is a runtime execution environment that manages apps that target the .NET Framework. The .NET Framework tries to maximize backward compatibility.

If there are two versions of .net framework on your pc, the target framework version of app and a higher version. The version of the .NET Framework that an application targets is determined by the target version of the entry assembly for the application domain that the code is running in.(check the Docs: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/application-compatibility ). You can go to the app.configfile that comes with the app and found that the supported runtime version and the sku version.

  • The runtime version attribute specifies the Common Language Runtime (CLR) version that is required for a given application. Note that all .NET Framework v4.x versions specify the v4.0 CLR.
  • The sku attribute uses a target framework moniker (TFM) to indicate the version of the .NET Framework that the app targets and requires to run.

Detail info : https://docs.microsoft.com/zh-cn/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element .

BTW.you should not uninstall any versions of the .NET Framework that are installed on your computer, because an application you use may depend on a specific version and may break if that version is removed. You can load multiple versions of the .NET Framework on a single computer at the same time. 

Best Regards

May


这篇关于.NET Framework构建版本与已安装版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆