microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
228 stars 12 forks source link

[BUG] Run into errors while opening the solution: Error: values.Count > 0 #1379

Open jbevain opened 2 months ago

jbevain commented 2 months ago

Describe the Issue

Opening a .sln file with empty configurations fails with non descriptive message:

Run into errors while opening the solution: Error: values.Count > 0

Steps To Reproduce

Create:

bug.sln:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35208.52
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bug", "bug.csproj", "{2B63A9D3-EB26-4265-8670-97701FAB635B}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {68CB54A7-C3CD-4A29-9C25-2A7B10A85152}
    EndGlobalSection
EndGlobal

bug.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

bug.cs:

Console.WriteLine("Hello");

Expected Behavior

Both VS and VSMac manage to open the sln, if only to write them back with default configuration.

Environment Information

Tested on macOS and Windows

C# v2.43.16 (pre-release) C# DevKit 1.10.6 (pre-release)

jbevain commented 2 months ago

Side note: the tense of the error message is incorrect which is throwing off some translations, French for instance.