XUnit Failed to start debugger: "System.ArgumentException: '' is not a valid version string when click on Debug Test link in code
See original GitHub issue## Issue Description ##
Receive the following exception when click on Debug Test in VSCode:
Failed to start debugger: "System.ArgumentException: ‘’ is not a valid version string.\nParameter name: value\n at NuGet.Versioning.SemanticVersion.Parse (System.String value) [0x0001c] in <abdc5737ab7e41cea3dac044b117a5e1>:0 \n at OmniSharp.Services.DotNetCliService.GetVersion (System.String workingDirectory) [0x00011] in <f74664677128467483a2d7d479fee8cd>:0 \n at OmniSharp.DotNetTest.TestManager.Create (Microsoft.CodeAnalysis.Project project, OmniSharp.Services.IDotNetCliService dotNetCli, OmniSharp.Eventing.IEventEmitter eventEmitter, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) [0x0000c] in <273b8594db1b4c2b8cba30203f5465f6>:0 \n at OmniSharp.DotNetTest.TestManager.Start (Microsoft.CodeAnalysis.Project project, OmniSharp.Services.IDotNetCliService dotNetCli, OmniSharp.Eventing.IEventEmitter eventEmitter, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, System.Boolean noBuild) [0x00000] in <273b8594db1b4c2b8cba30203f5465f6>:0 \n at OmniSharp.DotNetTest.Services.BaseTestService.CreateTestManager (System.String fileName, System.Boolean noBuild) [0x00011] in <273b8594db1b4c2b8cba30203f5465f6>:0 \n at OmniSharp.DotNetTest.Services.DebugTestService.Handle (OmniSharp.DotNetTest.Models.DebugTestGetStartInfoRequest request) [0x0000d] in <273b8594db1b4c2b8cba30203f5465f6>:0 \n at OmniSharp.Endpoint.Exports.RequestHandlerExportHandler2[TRequest,TResponse].Handle (TRequest request) [0x00000] in <f74664677128467483a2d7d479fee8cd>:0 \n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler2[TRequest,TResponse][] handlers, TRequest request) [0x00022] in <f74664677128467483a2d7d479fee8cd>:0 \n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <f74664677128467483a2d7d479fee8cd>:0 \n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <f74664677128467483a2d7d479fee8cd>:0 \n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <25283e844b74454aa89c7ebce6d25dc5>:0 "
## Steps to Reproduce ##
Created a xunit project with ```dotnet new xunit```
With these packages installed:
``` xml
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>
Created an XUnit test class and a Collection fixture.
Expected Behavior
Able to debug the test
Actual Behavior
Fails with exception provided above
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.48.0 C# Extension: 1.23.1
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.302 Commit: 41faccf259Runtime Environment: OS Name: Mac OS X OS Version: 10.15 OS Platform: Darwin RID: osx.10.15-x64 Base Path: /usr/local/share/dotnet/sdk/3.1.302/
Host (useful for support): Version: 3.1.6 Commit: 3acd9b0cd1
.NET Core SDKs installed: 3.1.101 [/usr/local/share/dotnet/sdk] 3.1.102 [/usr/local/share/dotnet/sdk] 3.1.302 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
csharp | ms-dotnettools | 1.23.1 |
dotenv | mikestead | 1.0.1 |
go | golang | 0.16.1 |
mssql | ms-mssql | 1.9.0 |
vscode-docker | ms-azuretools | 1.5.0 |
vscode-eslint | dbaeumer | 2.1.8 |
vscode-postgres | ckolkman | 1.1.11 |
vscode-proto3 | zxh404 | 0.4.2 |
vscode-rufo | jnbt | 0.0.1 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top GitHub Comments
I’m on latest VSCode and can still reproduce this error.
Currently no tests in my projects are debuggable.
i rebuilt my test project file by file after running
dotnet new
and everything runs correctly on Linux; the only difference was the version ofMicrosoft.NET.Test.Sdk
: 16.7.1 works, 16.8.3 is suspect