NLog 无法与 MSTest 一起使用,配置应该放在哪里?

发布于 2024-10-09 06:12:06 字数 137 浏览 0 评论 0原文

我们最近将测试从 NUnit 迁移到 MSTest,我正在努力让之前通过的测试运行。据我所知,MSTest 无法检测到 NLog 配置。 我的 App.config 中有 Nlog 配置,这不会导致 NUnit 出现问题。

有人有什么想法吗?

We have recently migrated tests from NUnit to MSTest and I am struggling to get previously passing tests runnning. From what I can deduce MSTest cannot detect the NLog configuration.
I have my Nlog configuration in my App.config which didn't cauise an issue with NUnit.

Has anyone any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月下伊人醉 2024-10-16 06:12:06

将 App.config 的复制到输出目录设置更改为始终复制如果较新则复制。有关此内容的更多信息此处。

示例单元测试项目

Change the Copy to Output Directory setting for your App.config to Copy Always or Copy if Newer. More on this here.

Example of a Unit Test Project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文