sdk: dotnet test does no longer accept a project path after updating to NET 7.0.101
Describe the bug
After updating NET 7.0.100 to NET 7.0.101 dotnet test does no longer accept a project path as an argument.
To Reproduce
Sample test project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
using Xunit;
namespace ClassLibrary1
{
public class Class1
{
[Fact]
public void Test()
{
}
}
}
With NET 7.0.101 this does not work
C:\>dotnet --version
7.0.101
C:\>dotnet test C:\Users\Administrator\Desktop\ClassLibrary1.csproj
Befehl oder Argument "C:\Users\Administrator\Desktop\ClassLibrary1.csproj" nicht erkannt
With NET 7.0.100 this worked
C:\>dotnet --version
7.0.100
C:\>dotnet test C:\Users\Administrator\Desktop\ClassLibrary1.csproj
Determining projects to restore...
All projects are up-to-date for restore.
ClassLibrary1 -> C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll
Test run for C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.4.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
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 - ClassLibrary1.dll (net7.0)
This also affects the built in dotnet command in Azure Dev Ops.

Workarounds
-
Set the environment variable
DOTNET_CLI_UI_LANGUAGE=en-US. -
Running
donet testdirectly in the project directory does work:
C:\Users\Administrator\Desktop>dotnet test
Wiederherzustellende Projekte werden ermittelt...
Alle Projekte sind für die Wiederherstellung auf dem neuesten Stand.
ClassLibrary1 -> C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll
Testlauf für "C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll" (.NETCoreApp,Version=v7.0)
Microsoft (R) Testausführungs-Befehlszeilentool Version 17.4.0 (x64)
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Die Testausführung wird gestartet, bitte warten...
Insgesamt 1 Testdateien stimmten mit dem angegebenen Muster überein.
Bestanden! : Fehler: 0, erfolgreich: 1, übersprungen: 0, gesamt: 1, Dauer: < 1 ms - ClassLibrary1.dll (net7.0)
- Running
donet testreferencing a DLL or exe does work:
C:\Users\Administrator\Desktop>dotnet test C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll
Wiederherzustellende Projekte werden ermittelt...
Alle Projekte sind für die Wiederherstellung auf dem neuesten Stand.
ClassLibrary1 -> C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll
Testlauf für "C:\Users\Administrator\Desktop\bin\Debug\net7.0\ClassLibrary1.dll" (.NETCoreApp,Version=v7.0)
Microsoft (R) Testausführungs-Befehlszeilentool Version 17.4.0 (x64)
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Die Testausführung wird gestartet, bitte warten...
Insgesamt 1 Testdateien stimmten mit dem angegebenen Muster überein.
Bestanden! : Fehler: 0, erfolgreich: 1, übersprungen: 0, gesamt: 1, Dauer: < 1 ms - ClassLibrary1.dll (net7.0)
Further technical details
C:\>dotnet --info
.NET SDK:
Version: 7.0.101
Commit: bb24aafa11
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.20348
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.101\
Host:
Version: 7.0.1
Architecture: x64
Commit: 97203d38ba
.NET SDKs installed:
7.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 14
- Comments: 22 (11 by maintainers)
Setting the environment variable
DOTNET_CLI_UI_LANGUAGE=en-USdoes also fix the issue.Probably introduced with this pr: https://github.com/dotnet/sdk/pull/27961
This is blocking all of my CI runs
Copying the latest PR update here:
We’ve encountered this error today after updating our build agents. While waiting for the servicing release, we’ll try to make do with the workaround. Thanks for the fast response!
On the other hand, something similar happened in the previous release that also broke our CI setup. (https://github.com/microsoft/vstest/issues/4014) It’s making us wary of updating to newer releases of the .NET SDK. 😢 Would it be posible to provide something akin to hotfix releases when these kind of errors occur?
Thanks for reporting it, we’re investigating.
Azure DevOps Pipelines stopped working for me aswell.
Per @baronfel’s comment above, this fix is expected to be released in 7.0.103 in February
@meriturva just tested it, does not work
~@meriturva the fix for this issue will be into
7.0.103not7.0.2as described here https://github.com/dotnet/sdk/issues/29543#issuecomment-1359646795 by @baronfel~Sorry misread, @baronfel do you have info about it?
If it’s failing in parsing, that would likely be a System.CommandLine issue. You could file an issue here: https://github.com/dotnet/command-line-api but @baronfel @adamsitnik may be able to help.
@MarcoRossignoli here is the german output with
DOTNET_CLI_VSTEST_TRACE=1When changing the Windows display language to
English (United States)it works:Same here with teamcity!
here my log from a build:
Seems to be the same moving from .net SDK 6.0.403 to .net 6.0.404