Execute xunit tests on hosted build controller

You can use xunit to unit test on the hosted build controller by installing the xunit.runner.visualstudio package.

But when the Build is done, there was an error.
Exception discovering tests from C:\a\bin\xunit.runner.visualstudio.testadapter.dll: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

The testrunner tries to discover the unittests in xunit.runner.visualstudio.testadapter.dll. Why? Because it matches the default test sources spec of *.test*.dll.
test sources spec
Change the spec to something more specific (like *unittest.dll) and everything works fine.

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , . Bookmark the permalink.

2 Responses to Execute xunit tests on hosted build controller

  1. Magnus Markling says:

    This is sooo awesome! You just saved my day, thanks a lot! If you have the time, please see this related issue on GitHub, and provide any additional info you can.

  2. Pingback: Week 17 roundup | .NET Development by Eric

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.