-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Cannot convert from 'Spectre.Console.Table' to 'string' #971
Comments
What version of Spectre.Console are you using? .NET 6? |
Thank you for so fast reply, it's awesome! Yes: .NET 6.0.203, Spectre.Console 0.41.0. |
One of the versions since 0.41.0 we switched around some syntax to make things consistent in their behavior. Back then I'd recommend updating to a new version as we've done a ton of improvements in the past year. |
Great idea, but I couldn't use other examples from documentation with the recent versions... All right, let's forget about it. Thank you for your support. |
What examples didn't work? If that's the case then we want to address that. |
Need to figure out what part of the documentation is wrong with the latest version. |
:-) All right, I will repeat the exercise and find something useful during the weekend. |
All right, so the Program.cs looks like this: using Microsoft.Extensions.DependencyInjection;
using Spectre.Console;
using Spectre.Console.Cli;
public static class Program
{
public static int Main(string[] args)
{
var app = new CommandApp();
app.Configure(config =>
{
config.PropagateExceptions();
});
try
{
return app.Run(args);
}
catch (Exception ex)
{
AnsiConsole.WriteException(ex, ExceptionFormats.ShortenEverything);
return -99;
}
}
} The .csproj file looks like this: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>test_spectre</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
</ItemGroup>
</Project> The output of the build process contains: |
According to the tutorial documentation, CommandApp is the entry point for a Spectre.Console.Cli command line application, this is also repeated in API Reference. |
The previous code works with 0.44. Does not work with 0.45. |
We split the |
This is a good catch though I'll update the docs tonight to include a reference to the new package |
The following code returns the error:
The build output:
Could anyone help me?
The text was updated successfully, but these errors were encountered: