Is it possible to use C# 4.0 with Visual Studio 2008?

前端 未结 2 1283
南笙
南笙 2020-12-20 17:21

I\'m pretty aware that Visual Studio 2010 works with C# 4.0. But now I was wandering if I\'m able to test C# 4.0 features with Visual Studio 2008.

I did that one tim

2条回答
  •  爱一瞬间的悲伤
    2020-12-20 17:51

    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.

    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.

提交回复
热议问题