The type or namespace name 'Builder' does not exist in the namespace 'System.CommandLine'

Agregando una version anterior:

dotnet add package System.CommandLine --version 2.0.0-beta1.20158.1 

Lo agrega al .csproj pero falla el Build.

Unas horas más tarde ...

Maravillosamente, y luego de repetir el proceso varias veces, en el que, de nuevo, rm bin/ y dotnet run, con downgrade para System.CommandLine, pues --prerelease instala la más reciente, version="2.0.0-beta3.22114.1" en el csproj, llego a obtener solo este error:


The type arguments for method 'Handler.SetHandler<T>(Command, Action<T>, params IValueDescriptor[])' cannot be inferred from the usage. Try specifying the type arguments explicitly.

Otras horas más tarde ... 

¡No mamar!: ya me salió, tras una breve revisión de los parámetros (churrazo): poner <string,string> aquí

addLinkCommand.SetHandler<string,string>(OnHandleAddLinkCommand, nameOption, urlOption);


Por esto:

var nameOption = new Option<string>
var urlOption = new Option<string>

Cfr. source code Building CLI Applications with C# and .NET: A step-by-step guide to developing cross-platform CLI apps—from coding and testing to deployment, Chapter 4.

Comments

Popular posts from this blog

solved ERROR You installed yt-dlp from a manual build or with a package manager

vorago stela 100 no enciende

lanix neuron a v20