Error While Running dotnet test

Had this error while running automated test on my dotnet core application thru Bitbucket Pipeline

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: < 1 ms - micro-service-test.dll (net8.0)
Testhost process for source(s) '/opt/atlassian/pipelines/agent/build/micro-service/bin/Debug/net8.0/micro-service.dll' exited with error: Error:
  An assembly specified in the application dependencies manifest (testhost.deps.json) was not found:
    package: 'Microsoft.TestPlatform.CommunicationUtilities', version: '17.11.1-release-24455-02'
    path: 'Microsoft.TestPlatform.CommunicationUtilities.dll'
. Please check the diagnostic logs for more information.

Apperently this happen because of my main project is detected as test folder. We can exclude it by adding this configuration in .csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <IsTestProject>false</IsTestProject>
  </PropertyGroup>
</Project>

1 thought on “Error While Running dotnet test”

  1. Jose Santiago

    Scouring the internet for a solution to this same issue and only found it here. You’re a life saver. Thank you!

Leave a Comment

Your email address will not be published.