0

I have only visual studio 2010 in my machine. But, when I look at the visual studio command prompt for "clrver", it shows two versions of CLR are installed in my machine - v2.0.5 and v4.0.3

From this link, I understand only the CLR version v4.0.3 should be available in my machine. http://msdn.microsoft.com/en-us/library/bb822049.aspx

But I am confused how I got v2.0.5. please explain?

4

2 回答 2

3

Visual Studio 2010 允许您编写面向多个 NET Framework 版本(2.0、3.0、3.5 和 4.0)的应用程序。

您会从链接到的文章中注意到,.NET Framework 版本 2.0、3.0 和 3.5 都共享相同的 CLR 版本:2.0,而 4.0 使用 CLR 的新版本 4.0。

因此,为了让 VS2010 允许您处理 2.0-3.5 项目,它需要安装 2.0 CLR。这就是安装它的原因。

于 2013-03-20T04:42:59.080 回答
0

简单地说,当 clrver 告诉

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>clrver

Microsoft (R) .NET CLR Version Tool  Version 4.0.30319.17929
Copyright (c) Microsoft Corporation.  All rights reserved.

Versions installed on the machine:
v2.0.50727
v4.0.30319

它实际上意味着

  • 您在这台机器上安装了 .NET 2/3/3.5
  • 您在这台机器上安装了 .NET 4 或 4.5

输出仅与您计算机上安装的 .NET Frameworks 相关,与您使用的 Visual Studio 版本无关。

CLR v2.0.50727 由 .NET 2.0/3.0/3.5 共享,而 CLR v4.0.30319 由 .NET 4.0 和 4.5 共享。请尝试将 .NET Framework 和 CLR 视为独立的概念。我知道初学者很难将它们彼此区分开来。

请注意,它是原子概念v2.0.50727,而不是2.0.5mate 。2.0.50727这也适用于v4.030319.

您对 MSDN 文章的解释不正确。为了避免进一步的误解,您可能会从诸如 CLR 通过 C# 等书籍中阅读更多关于 CLR 的信息。

于 2013-03-20T05:31:04.373 回答