I have updated my shared code to use dotnet standard 2.1 so I can use span. After doing this my nunit unit test project had to be converted to dotnet core so that it could reference the dotnet standard 2.1 project (full framework has no support past 2.0)
This means that I now need to run my test in my CI using dotnet test. I would like to do this at the solution level. However when I do so dotnet test gets upset about the Xamarin.Android project which it does not understand. The test still run fine but dotnet test returns an error code which fails the build.
Initially I got the following error:
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\3.0.101\Xamarin\Android\Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk
I fixed this by adding a condition that the targets file exists, but that resulted in the following error which I don't know how to solve.
error MSB4057: The target "VSTest" does not exist in the project.
The Xamarin.Android project has no tests in it but there doesn't seem to be anyway to tell dotnet test to ignore it.
Anyone know how to work around this problem?