本文介绍了编译为C#3.0和ISO-1或ISO-2之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2010中,高级构建设置下存在的语言版本下列选项:

In Visual Studio 2010, under "Advanced Build Settings" there is the following options for "Language Version":

  • 默认
  • ISO-1
  • ISO-2
  • 在C#3.0

有什么优势,编译为C#3.0,例如:基准速度还是稳定性?

Is there any advantage to compiling as C# 3.0, e.g. benchmark speed or stability?

推荐答案

您应该乱用,这是如果你正在写code,比方说,VS 2010,但你想让你的唯一的一次是,code应编制较早的编译器(VS 2005和VS 2003)。这将限制语言功能,如LINQ(只在C#3),迭代块(仅在ISO-2及以上)等。

The only time you should mess with this is if you are writing code in, say, VS 2010, but you intend that the code should compile on earlier compilers (VS 2005 or VS 2003). This will limit language features, such as LINQ (only in C# 3), iterator blocks (only in ISO-2 and above), etc.

即使是这样,这是不健壮;有一些功能是pretty的尴尬检测,而不会被检测到 - 某种形式的泛型类型推断此受到影响,所以你还是应该对先前的编译器测试

Even then, it is not robust; there are some features that are pretty awkward to detect, and won't be detected - some forms of generic type inference are impacted by this, so you should still test against an earlier compiler.

除非你有充分的理由,用默认。通常情况下,默认被选中,呃,默认。如果选择ISO-1,那么你已经在某个时候改变你的VS设置。

Unless you have a reason, use "default". Normally, "default" is selected by, er, default. If it is selecting ISO-1, then you have changed your VS settings at some point.

没有通常与此相关的任何速度上的差异 - 这是对的langauge是可用;然而,我的没有的检查了一些微妙的情况下,如确实实地样事件实现恢复,如果较早的编译器选择的旧路。

There is not usually any speed difference associated with this - it is about the langauge that is available; however, I have not checked on some subtle cases, for example does the field-like-event implementation revert to the old-way if an earlier compiler selected.

这篇关于编译为C#3.0和ISO-1或ISO-2之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 09:14