7

Question is in title. 3.0 or 4.0?

Aen Sidhe
  • 1,181
  • 12
  • 25

2 Answers2

8

It will use the C# 4 compiler, so you can still use (some) C# 4 features.

If you want to restrict yourself to C# 3, click on the Advanced button in the project properties Build tab (bottom right) and you can choose the language version you want to use.

Community
  • 1
  • 1
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • @Jon, if it uses the C# 4.0 compiler how it will interpret the `dynamic` keyword when targeting .NET 3.5? I suppose it will generate a compile error as the class is not defined? – Darin Dimitrov Apr 13 '10 at 07:35
  • 1
    @Darin: I suspect it will give you an error saying that you can't use `dynamic` against .NET 3.5. Try it :) – Jon Skeet Apr 13 '10 at 07:37
  • 1
    wish I could, currently at 58% downloading VS 2010 Ultimate :-) – Darin Dimitrov Apr 13 '10 at 07:38
  • Did I undestand you correctly: even if I restrict myself by a language version option, it'll be compiled by 4.0 compiler but with additional restrictions? – Aen Sidhe Apr 13 '10 at 08:25
  • 1
    @Aen: Yes. This is like specifying the /langversion flag on the command line. – Jon Skeet Apr 13 '10 at 08:37
-3

Visual Studio 2010 will respect your target. If you set it to 3.5, it'll compile in 3.5.

Echiban
  • 849
  • 2
  • 11
  • 21