-
Notifications
You must be signed in to change notification settings - Fork 640
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following code returns the error:
using Spectre.Console;
namespace NewProject.Services;
public class ContextService : IContextService
{
private readonly IRootService _rootService;
public ContextService(IRootService rootService)
{
_rootService = rootService ?? throw new ArgumentNullException(nameof(rootService));
}
public void List()
{
var root = _rootService.GetPath();
DirectoryInfo info = new DirectoryInfo(root);
var directories = info.EnumerateDirectories();
var table = new Table();
table.Border = TableBorder.SimpleHeavy;
table.AddColumn("Context");
table.AddColumn("Path");
foreach (var item in directories)
{
table.AddRow(item.Name, item.FullName);
}
AnsiConsole.Write(table); // Here is C:\Repos\NewProject\Services\ContextService.cs(36,27)
}
}The build output:
C:\Repos\NewProject\Services\ContextService.cs(36,27): error CS1503: Argument 1: cannot convert from 'Spectre.Console.Table' to 'string' [C:\Repos\NewProject\NewProject.csproj]
The build failed. Fix the build errors and run again.
Could anyone help me?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working