Can you use optional parameters in code targeting .NET 3.5?

后端 未结 7 883
独厮守ぢ
独厮守ぢ 2020-11-30 10:46

I\'m looking to write a library that uses the new optional parameters feature of C# 4.0, but I want to target it to the 3.5 version of the framework. Is this possible?

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 11:40

    VS 2010 supports optional parameters in C# for .NET 3.5 solutions. One caveat however, is that the command-line compiler will report errors.

    So, if you have automated builds in running, - using NANT or something else using the command-line compiler - your builds will fail.

提交回复
热议问题