.net运行时2.0,而不是最新版本? [英] .net runtime 2.0 instead of the newest version?

查看:94
本文介绍了.net运行时2.0,而不是最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的计算机上,我已经安装了.NET Framework 2.0,然后又安装了.NET Fratmeworkt 3.0。但是最近我从一个程序中得到了一个异常,说事件1000,.NET Runtime 2.0错误报告。我想知道为什么该程序仍然使用.NET Runtime 2.0而不是新版本。如何检查特定程序使用的.NET Runtime版本?可以更改它吗?

On my computer I have installed .NET Framework 2.0 then later .NET Fratmeworkt 3.0. However recently i get an exception from one program saying "Event 1000, .NET Runtime 2.0 Error Reporting". I'm wondering, why this program is still using .NET Runtime 2.0 instead the new version. How could I check which version of .NET Runtime a specific program uses? Is possible to change it?

推荐答案

。NET运行时实际上表示公共语言运行时(CLR),即是.NET Framework 2.0、3.0和3.5的2.0版。仅在.NET 4.0中,CLR版本也增加到了4.0(关于SO上的双重版本,有很多问题令人困惑,有关详细概述,请参见答案)。因此,您看到的消息可能令人困惑,但仍然是正确的。

The ".NET runtime" actually means the "Common Language Runtime" (CLR), which has been version 2.0 for the .NET framework 2.0, 3.0 and 3.5. Only with .NET 4.0 the CLR version was also incremented to 4.0 (there are a lot of questions an confusion about this dual versioning on SO, for a nice overview see this answer). So the message your seeing might be confusing but is still correct.

如果尚未安装.NET 4.0,则.NET运行时2.0是您计算机上存在的唯一版本。

If you haven't installed .NET 4.0, the .NET runtime 2.0 is the only version present on your machine.

您可能想知道应用程序是否实际上是根据.NET Framework 3.0(3.5)而不是.NET Framework 2.0进行编译/构建的。

You might want to know if an application is actually compiled/build against the .NET framework 3.0 (3.5) instead of the .NET framework 2.0.

要获取此信息,您需要查看应用程序集的元数据,即存储对其他程序集(包括.NET框架本身的引用)的引用的位置-其他程序集的版本。

To get this information you need to look at the application assemblies' meta data, i.e. the place where references to other assemblies, including those of the .NET framework itself are stored - together with the version of those other assemblies.

要查看此信息,可以使用Reflector或随附的 ILDASM.EXE

To view this information you can use Reflector, or ILDASM.EXE which comes with the .NET Framework SDK (or Visual Studio).

例如,对二进制文件使用 ILDASM.EXE (可执行文件或DLL),然后打开 MANIFEST节点。您将看到类似这样的条目:

For example, using ILDASM.EXE on a binary (executable or DLL) of your choice, then open the "MANIFEST" node. You'll see entries like this:

.assembly extern System.Windows.Forms
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}

在这种情况下,这是从.NET 4.0应用程序获取的,仅引用 System.Windows.Forms.dll ,但我想您会明白的。

In thise case this was taken from a .NET 4.0 application and only refers to System.Windows.Forms.dll, but I think you get the picture.

通过指定 < supportedRuntime> 元素。有关此问题的更多讨论,请参见此堆栈溢出问题。 ?q = supportedRuntime& submit = search>其他。

You can (partly) influence which version of the runtime an application uses, by specifying the <supportedRuntime> element in your application's configuration file. For more discussion on this see this Stack Overflow question, among others.

这篇关于.net运行时2.0,而不是最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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