单元测试 DAL - 运行单元测试时停止连接

发布于 2024-08-13 08:02:35 字数 279 浏览 0 评论 0原文

我正在对 DAL(数据访问层)进行单元测试。

当我调试单元测试时,在运行单元测试构造函数之前,Visual Studio 会启动 WcfSvcHost。

它为什么要这么做?我正在模拟一切,这样我就可以测试我的 DAL 中的逻辑。除了运行我的单元测试之外,我不想让它做任何事情。

关于如何关闭它有什么想法吗?


编辑:我尝试转到测试项目的属性并关闭调试选项卡中的“启用 Visual Studio 托管进程”。然而,这并没有解决问题。 (WcfSvcHost 仍然启动。)

I am unit testing a DAL (Data Access Layer).

When I debug a unit test, before my unit test constructor is even run, Visual Studio fires up WcfSvcHost.

Why is it doing that? I am mocking out everything so I can just test what little logic there is in my DAL. I don't want it to do anything but run my unit test.

Any ideas on how to turn that off?


Edit: I tried going to the Properties of my Test Project and turning off "Enable the Visual Studio Hosting process" in the debug tab. However, this did not fix the issue. (WcfSvcHost still starts up.)

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

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

发布评论

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

评论(1

吖咩 2024-08-20 08:02:35

在 WCF 项目上,单击“属性”。

转到 WCF 选项选项卡。

在同一解决方案中调试另一个项目时,取消选中“启动 WCF 服务主机”。

On the WCF project, click properties.

Goto WCF options tab.

Uncheck Start WCF Service Host when debugging another project in the same solution.

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