XFEExtension.NetCore.XFEConsole
2.2.1
dotnet add package XFEExtension.NetCore.XFEConsole --version 2.2.1
NuGet\Install-Package XFEExtension.NetCore.XFEConsole -Version 2.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XFEExtension.NetCore.XFEConsole" Version="2.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XFEExtension.NetCore.XFEConsole" Version="2.2.1" />
<PackageReference Include="XFEExtension.NetCore.XFEConsole" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XFEExtension.NetCore.XFEConsole --version 2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XFEExtension.NetCore.XFEConsole, 2.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XFEExtension.NetCore.XFEConsole@2.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XFEExtension.NetCore.XFEConsole&version=2.2.1
#tool nuget:?package=XFEExtension.NetCore.XFEConsole&version=2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XFEExtension.NetCore.XFEConsole
简述
XFEExtension.NetCore.XFEConsole是一个可以允许用户进行远程输出的调试辅助工具,需要配合XFE工具箱来使用,当然也可以根据本DLL内的架构搭建一个调试工具
远程控制台
输出至远程控制台
await XFEConsole.UseXFEConsole(3280); // 使用XFE控制台并连接端口为3280的控制台调试终端
// await任务返回一个bool值,该值指示是否与调试终端连接成功
XFEConsole.ShowInDebug = true; // 是否在本地调试的Debug中展示,默认为 true
XFEConsole.UseConsoleColor = true; // 使用控制台颜色,默认为 true
XFEConsole.ShowInLocalConsole = true; // 是否在本地控制台中显示,默认为 false
XFEConsole.AutoAnalyzeObject = true; // 是否自动解析对象,而非直接输出对象的.ToString()方法,默认为 true
Console.WriteLine("Hello World!"); // 这条语句会在远程控制台中输出Hello World!
配合XUnit测试框架
class Program
{
[UseXFEConsole]
[SMTest]
static void TestMethod()
{
Console.WriteLine("使用XUnit框架输出");
}
}
日志
记录日志
XFEConsole.UseXFEConsoleLog(); // 使用XFE日志记录每一次Console.Write或者WriteLine的内容
Console.WriteLine("Hello World!"); // 会直接在日志中记录Hello World!
Console.Write("Hello"); // 缓存直到下一个Console.WriteLine的出现
Console.WriteLine(" World!"); // 此时才会记录Hello World!
Console.WriteLine("[DEBUG]This is a debug message"); // 会记录级别为DEBUG的日志
Console.WriteLine("[INFO]This is a info"); // 会记录级别为INFO的日志
Console.WriteLine("[TRACE]Throw at Main() on line:24 position:25"); // 会记录级别为TRACE的日志
Console.WriteLine("[ERROR]Exception thrown"); // 会记录级别为ERROR的日志
Console.WriteLine("[FATAL]Application crashed... unknown reason"); // 会记录级别为FATAL的日志
导入导出日志
var log = XFEConsole.Log.Export(); // 导出日志为文本
XFEConsole.Log.Clear() // 清除全部日志
XFEConsole.Log.Import(log); // 导入日志文本
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- XFEExtension.NetCore (>= 4.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XFEExtension.NetCore.XFEConsole:
| Package | Downloads |
|---|---|
|
XFEExtension.NetCore.ServerInteractive
Server interaction extension, including user identity verification and querying in conjunction with AutoConfig |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.1 | 140 | 4/7/2026 |
| 2.2.0 | 87 | 4/7/2026 |
| 2.1.0 | 144 | 4/5/2026 |
| 2.0.0 | 120 | 3/25/2026 |
| 1.2.3 | 501 | 1/22/2026 |
| 1.2.2 | 125 | 1/22/2026 |
| 1.2.1 | 115 | 1/7/2026 |
| 1.2.0 | 109 | 1/7/2026 |
| 1.1.2 | 492 | 1/31/2025 |
| 1.1.1 | 187 | 1/31/2025 |
| 1.1.0 | 179 | 12/1/2024 |
| 1.0.3 | 226 | 8/18/2024 |
| 1.0.2 | 222 | 8/14/2024 |
| 1.0.1 | 211 | 8/12/2024 |
| 1.0.0 | 195 | 8/7/2024 |
使 UseXFEConsoleLog 支持可选参数并升级版本号
将 UseXFEConsoleLog 的参数 xFEConsoleLogOptions 改为可选,未传入时自动使用默认配置,提升方法易用性;同时将项目版本号提升至 2.2.1。