且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否可以使用C#4.0与Visual Studio 2008?

更新时间:2022-12-15 14:17:35

否。你不能使用.NET 4.0与VS2008,你不能使用C#4.0的功能 - 这是完全相同的情况,试图使VS2005处理C#3.0。编辑器,Intellisense等只是不知道新的功能。

No. You can't use .NET 4.0 with VS2008, and you can't use the C# 4.0 features either - it's exactly the same situation as trying to make VS2005 cope with C# 3.0. The editor, Intellisense etc just don't know about the new features.

一个重要的方面是,即使它看起来像像Visual Studio是只是使用外部 csc.exe 编译器,它不是 - 。进程内编译器与它附带的Visual Studio的版本绑定,所以它只知道当时可用的语言功能。

One important aspect is that even though it looks like Visual Studio is just using the external csc.exe compiler, it isn't - there's another "in-process" one. That in-process compiler is tied to the version of Visual Studio it comes with, so it only knows about the language features which were available at the time.