'AnsiConsole' 不包含 'Live' 的定义
'AnsiConsole' does not contain a definition for 'Live'
我正在使用 Spectre.Console 的 Spectre.Console extension for C# Console Application. And I wanted to use Live-Display 模块,但我遇到了以下问题:
'AnsiConsole' does not contain a definition for 'Live'
Here is my code, or better say, part of it which contains problem (... are parts which aren't required in sample, so during testing/debugging/modification remove them)
using System;
using Spectre.Console;
...
namespace ConsoleApp2
{
class Program
{
...
static void Main(...)
{
AnsiConsole.Live(Clock())
.Start(ctx =>
{
ctx.Refresh();
Thread.Sleep(1000);
});
...
}
...
public static void Clock()
{
Console.WriteLine(DateTime.Now.ToString());
}
...
}
...
}
Additional information
- 我使用 NuGet 包管理器和以下命令安装扩展:
PM> Install-Package Spectre.Console
,而不是文档中指示的 dotnet add package Spectre.Console
,但后一个选项不适用于一些原因所以我先用了。
- 我正在使用 Visual Studio 2019 社区版
- 我正在使用 .NET Framework 4.7.2
我正在使用 Spectre.Console 的 Spectre.Console extension for C# Console Application. And I wanted to use Live-Display 模块,但我遇到了以下问题:
'AnsiConsole' does not contain a definition for 'Live'
Here is my code, or better say, part of it which contains problem (... are parts which aren't required in sample, so during testing/debugging/modification remove them)
using System;
using Spectre.Console;
...
namespace ConsoleApp2
{
class Program
{
...
static void Main(...)
{
AnsiConsole.Live(Clock())
.Start(ctx =>
{
ctx.Refresh();
Thread.Sleep(1000);
});
...
}
...
public static void Clock()
{
Console.WriteLine(DateTime.Now.ToString());
}
...
}
...
}
Additional information
- 我使用 NuGet 包管理器和以下命令安装扩展:
PM> Install-Package Spectre.Console
,而不是文档中指示的dotnet add package Spectre.Console
,但后一个选项不适用于一些原因所以我先用了。 - 我正在使用 Visual Studio 2019 社区版
- 我正在使用 .NET Framework 4.7.2