Skip to content

dotnet test does no longer accept a project path after updating to NET 7.0.101 #29543

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
campersau opened this issue Dec 14, 2022 · 22 comments
Closed

Comments

@campersau
Copy link
Contributor

campersau commented Dec 14, 2022

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.
image

Workarounds

  • Set the environment variable DOTNET_CLI_UI_LANGUAGE=en-US.

  • Running donet test directly 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 test referencing 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
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-dotnet test untriaged Request triage from a team member labels Dec 14, 2022
@stefannikolei
Copy link

Probably introduced with this pr: #27961

This is blocking all of my CI runs

@matjankow
Copy link

Seems to be the same moving from .net SDK 6.0.403 to .net 6.0.404

@eluchsinger
Copy link

Azure DevOps Pipelines stopped working for me aswell.

@meriturva
Copy link

meriturva commented Dec 14, 2022

Same here with teamcity!

here my log from a build:

[15:07:25]E:	 [Step 4/7] dotnet test
[15:07:25] :		 [dotnet test] Starting:  [30;1m.NET SDK 7.0.101  [0m"C:\Program Files\dotnet\dotnet.exe" test C:\BuildAgent\work\588da65bbab212b8\Loccioni.Aulos.xUnit.sln --configuration Release --no-build @C:\BuildAgent\temp\agentTmp\2.rsp
[15:07:25] :		 [dotnet test] in directory: C:\BuildAgent\work\588da65bbab212b8
[15:07:25]W:		 [dotnet test] Il comando o l'argomento 'C:\BuildAgent\work\588da65bbab212b8\Loccioni.Aulos.xUnit.sln' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '/noconsolelogger' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '"/l:TeamCity.MSBuild.Logger.TeamCityMSBuildLogger,C:\BuildAgent\plugins\dotnet\tools\msbuild15\TeamCity.MSBuild.Logger.dll;TeamCity;plain"' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '/nodeReuse:false' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:VSTestLogger=logger://teamcity' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:VSTestTestAdapterPath=".%3BC:\BuildAgent\plugins\dotnet\tools\vstest15"' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:VSTestVerbosity=normal' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:Authors="Gruppo%20Loccioni"' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:Configuration=Release' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:Copyright="Copyright%20%40%20Loccioni%202022"' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:MajorVersion=1' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:MinorVersion=3' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:NodeJsVersion=16.17.0' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:PackageIconUrl=https://git.loccioni.com/uploads/-/system/group/avatar/5/logo_nuget.png' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:PackageProjectUrl=https://git.loccioni.com/aulos/loccioni-aulos-csharp-xunit.git' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:PatchVersion=4' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:PostfixVersion=-develop.38' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:ProjectsToBuild=*.sln' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:ProjectsToTest=*.sln' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:Stable=false' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:agent_home_dir=C:\BuildAgent' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:agent_name=gl-tc-agent05' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:agent_work_dir=C:\BuildAgent\work' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:build_number=1.3.4-develop.38' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:build_vcs_number=df4dc5efef2e70c7249fa857c19144cde92c14ff' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:build_vcs_number_1=df4dc5efef2e70c7249fa857c19144cde92c14ff' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:build_vcs_number_Aulos_LoccioniAulosCSharp_LoccioniAulosXUnit_Unique=df4dc5efef2e70c7249fa857c19144cde92c14ff' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:java_io_tmpdir=C:\BuildAgent\temp\buildTmp' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_agent_cpuBenchmark=807' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_agent_dotnet_agent_url=http://localhost:9090/RPC2' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_agent_dotnet_build_id=72952' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_auth_password=*******' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_auth_userId="TeamCityBuildId%3D72952"' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_changedFiles_file=C:\BuildAgent\temp\buildTmp\teamcity.changedFiles.txt' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_checkoutDir=C:\BuildAgent\work\588da65bbab212b8' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_checkoutDir_expireHours=12' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_properties_file=C:\BuildAgent\temp\buildTmp\teamcity.build.parameters' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_tempDir=C:\BuildAgent\temp\buildTmp' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_build_workingDir=C:\BuildAgent\work\588da65bbab212b8' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_buildConfName=Unique' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_buildType_id=Aulos_LoccioniAulosCSharp_LoccioniAulosXUnit_Unique' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_configuration_properties_file=C:\BuildAgent\temp\buildTmp\teamcity.config.parameters' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitaddin=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitlauncher=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitlauncher_msbuild_task=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitlauncher1_1=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitlauncher2_0=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_nunitlauncher2_0_vsts=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_dotnet_platform=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_nuget_feed__Root_default_publicUrl=https://teamcity.loccioni.com/httpAuth/app/nuget/feed/_Root/default/' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_nuget_feed__Root_default_url=https://teamcity.loccioni.com/httpAuth/app/nuget/feed/_Root/default/' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_projectName=Loccioni.Aulos.xUnit' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_runner_properties_file=C:\BuildAgent\temp\buildTmp\teamcity.runner.parameters' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_tests_recentlyFailedTests_file=C:\BuildAgent\temp\buildTmp\teamcity.testsToRunFirst.txt' non è stato riconosciuto
[15:07:25]W:		 [dotnet test] Il comando o l'argomento '-p:teamcity_version="2022.10.1 (build 116934)"' non è stato riconosciuto
[15:07:25] :		 [dotnet test] Description:
[15:07:25] :		 [dotnet test]   Driver di test .NET
[15:07:25] :		 [dotnet test] 
[15:07:25] :		 [dotnet test] Usage:
[15:07:25] :		 [dotnet test]   dotnet test [options] [[--] <additional arguments>...]]
[15:07:25] :		 [dotnet test] 
[15:07:25] :		 [dotnet test] Options:
[15:07:25] :		 [dotnet test]   -s, --settings <SETTINGS_FILE>                             File di impostazioni da usare durante l'esecuzione dei test.
[15:07:25] :		 [dotnet test]   -t, --list-tests                                           Elenca i testi individuati invece di eseguirli.
[15:07:25] :		 [dotnet test]   -e, --environment <NAME="VALORE">                          Imposta il valore di una variabile di ambiente. 
[15:07:25] :		 [dotnet test]                                                              Crea la variabile se non esiste e la sostituisce se esiste. 
[15:07:25] :		 [dotnet test]                                                              In questo modo forza l'esecuzione dei test in un processo isolato. 
[15:07:25] :		 [dotnet test]                                                              È possibile specificare più volte questo argomento per fornire più variabili.
[15:07:25] :		 [dotnet test]   
[15:07:25] :		 [dotnet test]                                                              Esempi:
[15:07:25] :		 [dotnet test]                                                              -e VARIABLE=abc
[15:07:25] :		 [dotnet test]                                                              -e VARIABLE="valore con spazi"
[15:07:25] :		 [dotnet test]                                                              -e VARIABLE="valore;delimitato da;punti e virgola"
[15:07:25] :		 [dotnet test]                                                              -e VAR1=abc -e VAR2=def -e VAR3=ghi
[15:07:25] :		 [dotnet test]   --filter <EXPRESSION>                                      Esegue i test corrispondenti all'espressione specificata.
[15:07:25] :		 [dotnet test]                                                                                                      Esempi:
[15:07:25] :		 [dotnet test]                                                                                                      Consente di eseguire test con priorità impostata su 1: --filter "Priority = 1"
[15:07:25] :		 [dotnet test]                                                                                                      Consente di eseguire un test con il nome completo specificato: --filter "FullyQualifiedName=Namespace.ClassName.MethodName"
[15:07:25] :		 [dotnet test]                                                                                                      Consente di eseguire test che contengono il nome specificato: --filter "FullyQualifiedName~Namespace.Class"
[15:07:25] :		 [dotnet test]                                                                                                      Per altre informazioni sul supporto dei filtri, vedere https://aka.ms/vstest-filtering.
[15:07:25] :		 [dotnet test]   --test-adapter-path <ADAPTER_PATH>                         Percorso degli adattatori personalizzati da usare per l'esecuzione dei test.
[15:07:25] :		 [dotnet test]   -l, --logger <LOGGER>                                      Logger da usare per i risultati dei test.
[15:07:25] :		 [dotnet test]                                                                                                      Esempi:
[15:07:25] :		 [dotnet test]                                                                                                      Log in formato trx con nome file univoco: --logger trx
[15:07:25] :		 [dotnet test]                                                                                                      Log in formato trx con il nome file specificato: --logger "trx;LogFileName=<TestResults.trx>"
[15:07:25] :		 [dotnet test]                                                                                                      Per altre informazioni sugli argomenti del logger, vedere https://aka.ms/vstest-report.
[15:07:25] :		 [dotnet test]   -o, --output <OUTPUT_DIR>                                  Directory di output in cui inserire gli artefatti compilati.
[15:07:25] :		 [dotnet test]   -d, --diag <LOG_FILE>                                      Abilita la registrazione dettagliata nel file specificato.
[15:07:25] :		 [dotnet test]   --no-build                                                 Non compila il progetto prima del test. Implica --no-restore.
[15:07:25] :		 [dotnet test]   --results-directory <RESULTS_DIR>                          Directory in cui verranno inseriti i risultati del test.
[15:07:25] :		 [dotnet test]                                                              Se non esiste, la directory specificata verrà creata.
[15:07:25] :		 [dotnet test]   --collect <DATA_COLLECTOR_NAME>                            Nome descrittivo dell'agente di raccolta dati da usare per l'esecuzione dei test.
[15:07:25] :		 [dotnet test]                                                                                                      Per altre informazioni, vedere: https://aka.ms/vstest-collect
[15:07:25] :		 [dotnet test]   --blame                                                    Esegue i test in modalità di segnalazione errore. Questa opzione è utile per isolare test problematici che causano l'arresto anomalo o il blocco dell'host di test. 
[15:07:25] :		 [dotnet test]                                                              Quando viene rilevato un arresto anomalo, crea in TestResults/guid/guid_Sequence.xml un file di sequenza che acquisisce l'ordine dei test eseguiti prima dell'arresto anomalo.
[15:07:25] :		 [dotnet test]                                                              Sulla base di impostazioni aggiuntive, possono essere raccolti anche i dump di blocco o di arresto anomalo.
[15:07:25] :		 [dotnet test]                                                              Esempio: 
[15:07:25] :		 [dotnet test]                                                                Timeout dell'esecuzione dei test quando il test impiega più del timeout predefinito di un'ora e raccoglie il dump di arresto anomalo in caso di chiusura imprevista dell'host di test. 
[15:07:25] :		 [dotnet test]                                                                Per i dump di arresto anomalo è richiesta una configurazione aggiuntiva. Vedere di seguito.
[15:07:25] :		 [dotnet test]                                                                dotnet test --blame-hang --blame-crash
[15:07:25] :		 [dotnet test]                                                              Esempio: 
[15:07:25] :		 [dotnet test]                                                                Timeout dell'esecuzione dei test quando un test impiega più di 20 minuti e raccoglie il dump di blocco. 
[15:07:25] :		 [dotnet test]                                                                dotnet test --blame-hang-timeout 20min
[15:07:25] :		 [dotnet test]   --blame-crash                                              Esegue i test in modalità di segnalazione errore e abilita la raccolta del dump di arresto anomalo del sistema in caso di chiusura imprevista dell'host di test. 
[15:07:25] :		 [dotnet test]                                                              Questa opzione è attualmente supportata in Windows e richiede la presenza di procdump.exe e procdump64.exe in PATH.
[15:07:25] :		 [dotnet test]                                                              In alternativa, è necessario impostare la variabile di ambiente PROCDUMP_PATH in modo che punti a una directory che contiene procdump.exe e procdump64.exe. 
[15:07:25] :		 [dotnet test]                                                              È possibile scaricare gli strumenti dall'articolo seguente: https://docs.microsoft.com/sysinternals/downloads/procdump 
[15:07:25] :		 [dotnet test]                                                              Implica --blame.
[15:07:25] :		 [dotnet test]   --blame-crash-dump-type <blame-crash-dump-type>            Tipo di dump di arresto anomalo del sistema da raccogliere. Implica --blame-crash.
[15:07:25] :		 [dotnet test]   --blame-crash-collect-always <blame-crash-collect-always>  Abilita la raccolta del dump di arresto anomalo in caso di chiusura prevista e imprevista dell'host di test.
[15:07:25] :		 [dotnet test]   --blame-hang                                               Esegue i test in modalità di segnalazione errore e abilita la raccolta del dump di blocco quando il test supera il timeout specificato. Implica --blame-hang.
[15:07:25] :		 [dotnet test]   --blame-hang-dump-type <blame-hang-dump-type>              Tipo del dump di arresto anomalo da raccogliere. Quando è impostato su None, viene usato quando l'host di test viene terminato al raggiungimento del timeout, ma non viene raccolto alcun dump. Implica --blame-hang.
[15:07:25] :		 [dotnet test]   --blame-hang-timeout <TIMESPAN>                            Timeout per singolo test dopo il quale viene attivato il dump di blocco e il processo dell'host di test viene terminato. 
[15:07:25] :		 [dotnet test]                                                              Il valore di timeout viene specificato nel formato seguente: 1.5h / 90m / 5400s / 5400000ms. Quando non viene usata alcuna unità (ad esempio 5400000), si presuppone che il valore sia espresso in millisecondi.
[15:07:25] :		 [dotnet test]                                                              Se viene usato insieme a test basati sui dati, il comportamento di timeout dipende dall'adattatore di test usato. Per xUnit e NUnit il timeout viene rinnovato dopo ogni test case.
[15:07:25] :		 [dotnet test]                                                              Per MSTest il timeout viene usato per tutti i test case.
[15:07:25] :		 [dotnet test]                                                              Questa opzione è attualmente supportata solo in Windows insieme a netcoreapp2.1 e versioni successive, nonché in Linux con netcoreapp3.1 e versioni successive. OSX e la piattaforma UWP non sono supportati.
[15:07:25] :		 [dotnet test]   --nologo                                                   Esegui test senza visualizzare il banner di Microsoft Testplatform
[15:07:25] :		 [dotnet test]   -c, --configuration <CONFIGURATION>                        Configurazione da usare per eseguire i test. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'.
[15:07:25] :		 [dotnet test]   -f, --framework <FRAMEWORK>                                Framework di destinazione per cui eseguire i test. Il framework di destinazione deve essere specificato anche nel file di progetto.
[15:07:25] :		 [dotnet test]   -r, --runtime <RUNTIME_IDENTIFIER>                         Runtime di destinazione per cui eseguire il test.
[15:07:25] :		 [dotnet test]   --no-restore                                               Non ripristina il progetto prima della compilazione.
[15:07:25] :		 [dotnet test]   --interactive                                              Consente al comando di arrestare l'esecuzione e attendere l'input o l'azione dell'utente, ad esempio per completare l'autenticazione.
[15:07:25] :		 [dotnet test]   -v, --verbosity <LEVEL>                                    Consente di impostare il livello di dettaglio di MSBuild. I valori consentiti sono q[uiet], m[inimal], n[ormal], d[etailed] e diag[nostic].
[15:07:25] :		 [dotnet test]   -a, --arch <arch>                                          Architettura di destinazione.
[15:07:25] :		 [dotnet test]   --os <os>                                                  Sistema operativo di destinazione.
[15:07:25] :		 [dotnet test]   -?, -h, --help                                             Visualizza la Guida della riga di comando.
[15:07:25] :		 [dotnet test] 
[15:07:25] :		 [dotnet test] Additional Arguments:
[15:07:25] :		 [dotnet test]   Arguments passed to the application that is being run.
[15:07:25] :		 [dotnet test] 
[15:07:25]W:		 [dotnet test] Process exited with code 1
[15:07:23]E:		 [dotnet test] Process exited with code 1 (Step: Test (.NET))

@jansapp
Copy link

jansapp commented Dec 14, 2022

Same here

@MarcoRossignoli
Copy link
Member

Thanks for reporting it, we're investigating.

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Dec 14, 2022

Can you tell me if the same is happening for non localized version(en-us one)?
I see non default language usage in the samples above.

@MarcoRossignoli
Copy link
Member

@campersau can you enable verbose logging and retry the command?

C:\>set DOTNET_CLI_VSTEST_TRACE=1
C:\>dotnet test...
...
[dotnet test - 12/14/2022 4:17:29 PM]Logging to console
[dotnet test - 12/14/2022 4:17:29 PM +00:00]Argument list: 'C:\...'
[dotnet test - 12/14/2022 4:17:29 PM +00:00]MSBuild args from forwarded options: C:\...

You should see some verbose output [dotnet test...]

@campersau
Copy link
Contributor Author

@MarcoRossignoli here is the german output with DOTNET_CLI_VSTEST_TRACE=1

C:\>set DOTNET_CLI_VSTEST_TRACE=1
C:\>dotnet test C:\Users\Administrator\Desktop\ClassLibrary1.csproj
[dotnet test - 14.12.2022 16:29:07]Logging to console
[dotnet test - 14.12.2022 16:29:07 +00:00]Argument list: 'C:\Users\Administrator\Desktop\ClassLibrary1.csproj'
Befehl oder Argument "C:\Users\Administrator\Desktop\ClassLibrary1.csproj" nicht erkannt
Description:
  .NET-Testtreiber

Usage:
  dotnet test [options] [[--] <additional arguments>...]]

...

When changing the Windows display language to English (United States) it works:
image

C:\>set DOTNET_CLI_VSTEST_TRACE=1
C:\>dotnet test C:\Users\Administrator\Desktop\ClassLibrary1.csproj
[dotnet test - 12/14/2022 4:50:51 PM]Logging to console
[dotnet test - 12/14/2022 4:50:51 PM +00:00]Argument list: 'C:\Users\Administrator\Desktop\ClassLibrary1.csproj'
[dotnet test - 12/14/2022 4:50:51 PM +00:00]MSBuild args from forwarded options: C:\Users\Administrator\Desktop\ClassLibrary1.csproj
[dotnet test - 12/14/2022 4:50:51 PM +00:00]Root variable set VSTEST_WINAPPHOST_DOTNET_ROOT:C:\Users\Administrator\Downloads\dotnet-sdk-7.0.101-win-x64
[dotnet test - 12/14/2022 4:50:51 PM +00:00]Starting test using MSBuild with arguments '-maxcpucount -verbosity:m -restore -target:VSTest -nodereuse:false -nologo C:\Users\Administrator\Desktop\ClassLibrary1.csproj -property:VSTestArtifactsProcessingMode=collect -property:VSTestSessionCorrelationId=2416_5b9e1843-62f7-4ff5-91e0-2b5c8446d39b -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Users\Administrator\Downloads\dotnet-sdk-7.0.101-win-x64\sdk\7.0.101\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Users\Administrator\Downloads\dotnet-sdk-7.0.101-win-x64\sdk\7.0.101\dotnet.dll' custom MSBuild path '' norestore 'False'
  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)
[dotnet test - 12/14/2022 4:50:55 PM +00:00]No artifact found, post-processing won't run.

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Dec 14, 2022

Thanks I can confirm also on mine, something is wrong with the default parsing of arguments in non en-us

@vlada-shubina do you know who owns the parsing?
We get wrong parsing from the start
image

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Dec 14, 2022

@marcpopMSFT @baronfel what you think?

@marcpopMSFT
Copy link
Member

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.

@baronfel
Copy link
Member

@marcpopMSFT yep! I'll be digging in more shortly to help direct.

@campersau
Copy link
Contributor Author

Setting the environment variable DOTNET_CLI_UI_LANGUAGE=en-US does also fix the issue.

@baronfel
Copy link
Member

Copying the latest PR update here:

I think we're in a good space now with the algorithm and the tests for this check. I'll want to get another check from @dsplaisted to make sure he's comfortable with the implementation, but then we're ready to go.

A note about the timing of this fix: we are already beyond the merge window for the January servicing release of .NET 7 (which would be 7.0.102) due to the holiday season. As a result, this fix (when approved and merged) will only be available in the Februrary servicing release at earliest (so 7.0.103). This feels really bad, and isn't a great response time given the very fast time to reporting that users had, but it's the best I can do.

In the meantime, the best thing I can suggest for users that are hitting this error is to force the CLI to the English local for dotnet test. The easiest way to do that is to set the DOTNET_CLI_UI_LANGUAGE environment variable in your shell to en-US for the duration of the test command. e.g. in Bash you'd run DOTNET_CLI_UI_LANGUAGE='en-us' dotnet test ...... Full documentation for this environment variable can be found here.

@stefannikolei
Copy link

So these means we need to tweak our build process to get the security fixes in (which were released with 7.0.101) otherwise our apps are vulnerable till at least February?

@baronfel
Copy link
Member

@stefannikolei unfortunately yes, that's correct. It's very unfortunate that this problem was surfaced at this specific time - we usually have a much larger change window before lockdown/stabilization/testing phases.

@Starkie
Copy link

Starkie commented Dec 29, 2022

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. (microsoft/vstest#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?

@meriturva
Copy link

Seems a new version of .net 7 has been released (7.0.2). I will test it on Friday on one or two CI agents on our infrastructure, but I would like to know about other experiences here. Who has the opportunity to test it?

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Jan 11, 2023

@meriturva the fix for this issue will be into 7.0.103 not 7.0.2 as described here #29543 (comment) by @baronfel

Sorry misread, @baronfel do you have info about it?

@kenan-kajkus
Copy link

@meriturva just tested it, does not work

@marcpopMSFT
Copy link
Member

Per @baronfel's comment above, this fix is expected to be released in 7.0.103 in February

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests