为什么我不能显示ASP.NET Framework版本为3.5?版本、NET、ASP、Framework

2023-09-04 12:47:50 作者:江南的故事酒馆

是否有人可以证实,我认为当我的应用程序是用.NET 3.5,这code

Can someone please confirm to me that when my application is written in .NET 3.5 that this code

System.Environment.Version.Major.ToString()

会产生这种

2.0.50727.1433

我只是移动到3.5和第一个应用程序,我是移动的内部网站。我认为一个非常简单的指标,它的工作是添加了Framework版本下我的应用程序版本,但上面的文字是正在生产。

I'm just moving to 3.5 and the first application I'm moving is an internal website. I thought a really easy indicator that it's working would be to add the Framework version next to my Application version but the above text is what is being produced.

我的有限的研究表明,.NET 3.5是2.0的味道等底层框架的版本仍将是2.0。 IIS应用程序池设置的建议是这种情况。

My limited research suggests that .NET 3.5 is a 'flavour' of 2.0 and so the underlying framework version will continue to be 2.0. The IIS application pool settings suggest this is the case.

这是正确的或者我可以让我的应用程序,以显示3.5?

Is this correct or can I get my application to show 3.5?

干杯

推荐答案

由于.NET 3.5使用CLR运行时版本2,3.5只是一套建立在2.0运行时的顶部组件。内部API,不能看出其中的差别。下面是一些code,它会告诉你是否3.5 present:

Because .NET 3.5 uses CLR runtime version 2. 3.5 is just a set of assemblies built on top of the 2.0 runtime. The internal APIs cannot tell the difference. Here is some code that will tell you whether 3.5 is present:

http://blogs.msdn.com/astebner/archive/2007/11/29/6608419.aspx

请注意这不会告诉你是否你的code实际上是针对3.5的,但是你应该反正照顾,在你的清单。

Note this will not tell you whether your code is actually running against 3.5, but you should be taking care of that in your manifest anyway.