使用 AOT 进行 NLog 单元测试
作者: snakefoot创建于 2026年9月3日更新于 2026年9月12日
标签unit-testsplatform support
微软不断地建议,在 AOT 构建时不应信任 .NET 代码的行为。似乎单元框架正在增加对使用 AOT 测试的支持:- https://xunit.net/docs/getting-started/v3/native-aot- https://tunit.dev/docs/writing-tests/aot- https://devblogs.microsoft.com/dotnet/mstest-source-generation/ 目前,NLog 项目仅用于验证 AOT 测试应用程序是否不会产生构建警告,并且可以使用 NLog ConsoleTarget 进行输出。
内容来源: NLog/NLog