You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting UseCommonOutputDirectory to true breaks dotnet test, when using dotnet 6.0 runner.
This occurs when TargetFrameowrk = net472, net48, and net6.0, but not net5.0.
Expected behavior would be for the test runner to work
using Xunit;
namespace PrimeService.Tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}
}
run dotnet test
When TargetFramework is net472 or net48, the error is:
PS C:\Users\lilith\imazen\resizer\PrimeService.Tests> dotnet test
Determining projects to restore...
All projects are up-to-date for restore.
PrimeService.Tests -> C:\Users\lilith\imazen\resizer\PrimeService.Tests\bin\Debug\net472\PrimeService.Tests.dll
Test run for C:\Users\lilith\imazen\resizer\PrimeService.Tests\bin\Debug\net472\PrimeService.Tests.dll (.NETFramework,Version=v4.7.2)
Microsoft (R) Test Execution Command Line Tool Version 17.2.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
No test is available in C:\Users\lilith\imazen\resizer\PrimeService.Tests\bin\Debug\net472\PrimeService.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
For net6.0, the error is:
PS C:\Users\lilith\imazen\resizer\PrimeService.Tests> dotnet test
Determining projects to restore...
Restored C:\Users\lilith\imazen\resizer\PrimeService.Tests\PrimeService.Tests.csproj (in 499 ms).
PrimeService.Tests -> C:\Users\lilith\imazen\resizer\PrimeService.Tests\bin\Debug\net6.0\PrimeService.Tests.dll
Test run for C:\Users\lilith\imazen\resizer\PrimeService.Tests\bin\Debug\net6.0\PrimeService.Tests.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.2.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args)
. Please check the diagnostic logs for more information.
Test Run Aborted.
Delete line <UseCommonOutputDirectory>true</UseCommonOutputDirectory> to see test execute properly.
This is most likely caused by TestPlatform.PlatformAbstractions that have different dependencies across frameworks. UseCommonOutputDirectory would remain unsupported until we significantly rewrite our code.
Setting
UseCommonOutputDirectory
to true breaks dotnet test, when usingdotnet
6.0 runner.This occurs when TargetFrameowrk = net472, net48, and net6.0, but not net5.0.
Expected behavior would be for the test runner to work
To reproduec
Create a new .csproj with the following
And a test class
run
dotnet test
When TargetFramework is net472 or net48, the error is:
For net6.0, the error is:
Delete line
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
to see test execute properly.Partial workaround
Further technical details
The text was updated successfully, but these errors were encountered: