title: My System.CommandLine app won't build! It can't find a CommandHandler. Do I need to write it?
body: <p>I am using VS 2022, .Net 6.0, and trying to build my first app using <code>System.CommandLine</code>.</p>
  <p>Problem: when I build it, I get an error</p>
  <blockquote>
  <p>The name 'CommandHandler' does not exist in the current context</p>
  </blockquote>
  <p>The code I'm trying to build is the sample app from the GitHub site: <a href="https://github.com/dotnet/command-line-api/blob/main/docs/Your-first-app-with-System-CommandLine.md" rel="noreferrer">https://github.com/dotnet/command-line-api/blob/main/docs/Your-first-app-with-System-CommandLine.md</a> , without alteration (I think).</p>
  <p>It looks like this:</p>
  <pre><code>using System;
  using System.CommandLine;
  using System.IO;
  
  static int Main(string[] args)
  {
      // Create a root command with some options
      var rootCommand = new RootCommand
          { 
          new Option&lt;int&gt;(
              &quot;--int-option&quot;,
              getDefaultValue: () =&gt; 42,
              description: &quot;An option whose argument is parsed as an int&quot;),
          new Option&lt;bool&gt;(
              &quot;--bool-option&quot;,
              &quot;An option whose argument is parsed as a bool&quot;),
          new Option&lt;FileInfo&gt;(
              &quot;--file-option&quot;,
              &quot;An option whose argument is parsed as a FileInfo&quot;)
      };
  
      rootCommand.Description = &quot;My sample app&quot;;
  
      // Note that the parameters of the handler method are matched according to the names of the options
      rootCommand.Handler = CommandHandler.Create&lt;int, bool, FileInfo&gt;((intOption, boolOption, fileOption) =&gt;
      {
          Console.WriteLine($&quot;The value for --int-option is: {intOption}&quot;);
          Console.WriteLine($&quot;The value for --bool-option is: {boolOption}&quot;);
          Console.WriteLine($&quot;The value for --file-option is: {fileOption?.FullName ?? &quot;null&quot;}&quot;);
      });
  
      // Parse the incoming args and invoke the handler
      return rootCommand.InvokeAsync(args).Result;
  }
  </code></pre>
  <p>I have installed the latest version of <code>System.Commandline</code>: 2.0.0-beta2.21617.1</p>
  <p><strong>SURELY</strong> I am just being a big fat idiot in some respect. But I don't see it.</p>
  <p>Any insight would be welcomed.</p>