Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing DAL - Stop Connecting when running unit tests

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.)

like image 883
Vaccano Avatar asked Feb 18 '26 17:02

Vaccano


1 Answers

On the WCF project, click properties.

Goto WCF options tab.

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

like image 73
longday Avatar answered Feb 20 '26 07:02

longday



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!