microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
159.32k stars 27.87k forks source link

After creating a C# test project (xunit, nunit), the project will no longer build #213011

Open scaredcr6w opened 2 weeks ago

scaredcr6w commented 2 weeks ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create a console application using 'dotnet new console --use-program-main'
  2. To the solution, add a new xunit test project
  3. Use 'dotnet build'

The following errors will show up: dotnet build ../vscode bug/TestProject1/TestProject1.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary MSBuild version 17.9.8+b34f75857 for .NET Determining projects to restore... All projects are up-to-date for restore. ../vscode bug/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs(4,12): error CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(13,12): error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(15,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(16,12): error CS0579: Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(17,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(18,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/obj/Debug/net8.0/vscode bug.AssemblyInfo.cs(19,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [../vscode bug/vscode bug.csproj] ../vscode bug/TestProject1/obj/Debug/net8.0/TestProject1.GlobalUsings.g.cs(9,22): error CS0400: The type or namespace name 'Xunit' could not be found in the global namespace (are you missing an assembly reference?) [../vscode bug/vscode bug.csproj] ../vscode bug/TestProject1/UnitTest1.cs(6,6): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?) [../vscode bug/vscode bug.csproj] ../vscode bug/TestProject1/UnitTest1.cs(6,6): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?) [../vscode bug/vscode bug.csproj]