是否可以在 Visual Studio 2008 中使用 C# 4.0? [英] Is it possible to use C# 4.0 with Visual Studio 2008?

查看:26
本文介绍了是否可以在 Visual Studio 2008 中使用 C# 4.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常清楚 Visual Studio 2010 可与 C# 4.0 配合使用.但是现在我在犹豫是否可以使用 Visual Studio 2008 测试 C# 4.0 功能.

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.

我曾经这样做过,使用 C# 3.0 和 Visual Studio 2005 破解 app.config 文件.

I did that one time, using C# 3.0 with Visual Studio 2005 hacking the app.config file.

有人在 VS2008 中成功使用 C# 4.0 吗?

Did anyone have any success using C# 4.0 in VS2008?

我已经安装了 Net Framework 4.0 测试版,重新启动,创建了一个新的 WPF 应用程序,选择了应用程序属性,但目标框架只能设置为 Net Framework 3.5.

I've installed Net Framework 4.0 beta, rebooted, created a new WPF application, chosen Application properties, but the Target Framework can be set only to Net Framework 3.5.

推荐答案

没有.您不能将 .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.

这篇关于是否可以在 Visual Studio 2008 中使用 C# 4.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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