dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.08k stars 4.04k forks source link

Cannot run tests in codespaces #59807

Closed dsyer closed 3 weeks ago

dsyer commented 2 years ago

Version Used: main

Steps to Reproduce:

  1. open codespaces
  2. find a test (e.g. /workspaces/roslyn/src/Scripting/CSharpTest/ScriptTests.cs)
  3. run it

Expected Behavior: green tests

Actual Behavior: failure

Failed to run test because "System.FormatException: Input string was not in a correct format.\n at OmniSharp.SemanticVersion.TryParseVersion(String version, VersionResult& result) in /Users/runner/work/1/s/src/OmniSharp.Abstractions/SemanticVersion.cs:line 288\n at OmniSharp.SemanticVersion.Parse(String version) in /Users/runner/work/1/s/src/OmniSharp.Abstractions/SemanticVersion.cs:line 181\n at OmniSharp.Services.DotNetCliService.GetVersion(String workingDirectory) in /Users/runner/work/1/s/src/OmniSharp.Host/Services/DotNetCliService.cs:line 133\n at OmniSharp.DotNetTest.TestManager.Create(Project project, IDotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory) in /Users/runner/work/1/s/src/OmniSharp.DotNetTest/TestManager.cs:line 63\n at OmniSharp.DotNetTest.Services.BaseTestService.CreateTestManager(String fileName, Boolean noBuild) in /Users/runner/work/1/s/src/OmniSharp.DotNetTest/Services/BaseTestService.cs:line 24\n at OmniSharp.DotNe...
JoeRobich commented 2 years ago

@dsyer This typically means that there is a global.json pinning a version of the SDK which is not installed. If you have the SDK installed to a local folder, you can set the omnisharp.dotnetPath to ensure the C# extension is using the correct install.

CyrusNajmabadi commented 3 weeks ago

The error indicates omnisharp, which is not part of roslyn.