Solution: Unable to find testhost.dll. Please publish your test project and retry. (C#/Visual Studio Error Solution)

Solution for: Unable to find testhost.dll. Please publish your test project and retry.

Last updated on 11/21/2021


I recently updated my test project to .NET Core 3.1 from .NET 4.7.1 and I noticed this error when I was trying to run my tests:

Unable to find testhost.dll. Please publish your test project and retry.

Unable to find testhost.dll. Please publish your test project and retry

My first thought was to Publish my test project and attempt to run the tests again, this failed again. Giving me the same error message:

Unable to find testhost.dll. Please publish your test project and retry.

Add Microsoft Test SDK

My next step was to add the nuget package Microsoft.NET.Test.SDK (I added version v16.5.0). Microsoft.Net.Test.Sdk v16.5.0 And that seemed to help me over the initial “publish your test project and retry” hurdle.

But then I was met with this message: Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again. Make sure that test discoverer and exectutors

Add NUNIT3TestAdapter

The next step I took was to add the NUNIT3TestAdapter (v3.16.1) package to my project: NUnit3TestAdapter Nuget Package v3.16.1

Then after rebuilding the solution and running the tests, everything worked as expected with all tests running.

My Project was built on .NET Core 3.1 using Microsoft Visual Studio Community 2019 Version 16.4.5

I hoped this post helped you out and thanks for reading!


Stack Overflow - Unable to find testhost.dll. Please publish your test project and retry

Stack Overflow - No test found. Make sure that installed test discoverers & executors...

Other References for this Problem:

Dot net core NUnit unit test won’t start