Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type or namespace name 'CliCommand' not found. #2485

Open
johnholliday opened this issue Sep 2, 2024 · 7 comments
Open

Type or namespace name 'CliCommand' not found. #2485

johnholliday opened this issue Sep 2, 2024 · 7 comments

Comments

@johnholliday
Copy link

Simple application fails to resolve.

Program.cs

using System.CommandLine;

public class SampleCommand : CliCommand // <-- CS0246
{

}

TestProgram.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
    <PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
  </ItemGroup>

</Project>

@NeverMorewd
Copy link

Is there any workaround?

@KalleOlaviNiemitalo
Copy link

2.0.0-beta4.22272.1 is two years old. In that version, the class is named System.CommandLine.Command:

public class Command : IdentifierSymbol, IEnumerable<Symbol>

@NeverMorewd
Copy link

Add a nuget source and update the nuget version to 2.0.0-beta4.24324.3
Daily builds are available if you add this feed to your nuget.config:
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json

@KalleOlaviNiemitalo
Copy link

If you have an application using System.CommandLine 2.0.0-beta4.22272.1 and you upgrade to 2.0.0-beta4.24324.3 from that dnceng feed, you need to adapt the app to breaking changes in the API… and then there'll be more API breaks if the main-powderhouse branch is eventually merged and released.

I haven't seen any promises about how long the https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json feed will exist. If I used packages from that in production, I'd make sure to archive them locally, so as to keep old versions of my app buildable even if the feed is deleted in the future.

@N7K4
Copy link

N7K4 commented Sep 26, 2024

Where can I find the current / latest documentation from. I updated from 2.0.0-beta4.22272.1 to 2.0.0-beta4.24324.3 . But there are a lot of changes, even breaking ones. But the docu is still on 2022 or 2023. Even there is no "hello-world" cli working example, with the newer versions of the CLI nuget package.

Developers are lost in the early beginning ...

@Balkoth
Copy link

Balkoth commented Sep 27, 2024

There is no documentation for the latest betas. It would be a waste of time anyway as the PowderHouse will completely change once again.

@KalleOlaviNiemitalo
Copy link

Up-to-date documentation for the main and main-powderhouse branches is not published.

@N7K4, if you are making a commercial product, I don't recommend using System.CommandLine in its current state, when there are only preview releases. Better use a different package or write your own parser.

If you're instead hacking on a hobby project, then I suppose you can use DocFX to generate API reference documentation in HTML. Concept documentation and examples would be missing though, so you'd have to spend time perusing the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants