difference in the behavior of optionalAttribute (used to declare an optional parameter) in VS 2010 vs VS 2008

前端 未结 2 1792
青春惊慌失措
青春惊慌失措 2021-01-05 03:42

A simple C# method with an optional parameter declared using the OptionalAttribute as

namespace  ClassLibrary11
{
   public class Class1
   {
      public in         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-05 04:13

    Optional parameters have been introduced with .NET 4.0 in C#, I am not sure what you are building with VS 2008 targetting an older framework, but I would say you should use them only in VS 2010 and .NET 4.0 Named and Optional Arguments

提交回复
热议问题