Wednesday 25 September 2019

Resolving Azure DevOps Build Error “data at the root level is invalid” in dotnet test

When you try to execute dotnet test with test assemblies in Azure DevOps builds built with Visual Studio 2019 you may run into an error “data at the root level is invalid”. Let’s look at how to solve this issue and get the tests executed in the Azure DevOps build pipelines.
The error
error MSB4025: The project file could not be loaded. Data at the root level is invalid.


How to resolve
Instead of using test.dll to execute the tests with dotnet test use the csproj files. This makes the running of the tests to work.

The test executes fine after this change.

No comments:

Popular Posts