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
18.85k stars 4.01k forks source link

Building twice in VS is broken. #74314

Closed CyrusNajmabadi closed 1 week ago

CyrusNajmabadi commented 1 month ago

On commit: 5c2d76c890d6974aa8c3b955965dc49b1c73bb43 VS: image

dotnet-issue-labeler[bot] commented 1 month ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 1 month ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

CyrusNajmabadi commented 1 month ago

Building once succeeds. The second time you get:

24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1471,87,1471,98): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1511,90,1511,101): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1534,87,1534,98): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1549,90,1549,101): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1582,100,1582,111): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(1602,96,1602,107): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
24>D:\github\roslyn\src\VisualStudio\CSharp\Impl\CodeModel\CSharpCodeModelService.cs(790,18,790,34): error CS0122: 'NotNullIfNotNullAttribute' is inaccessible due to its protection level
24>Done building project "Microsoft.VisualStudio.LanguageServices.CSharp.csproj" -- FAILED.
25>------ Build started: Project: RoslynDeployment, Configuration: Debug Any CPU ------
26>------ Build started: Project: Microsoft.VisualStudio.IntegrationTest.Setup, Configuration: Debug Any CPU ------
27>------ Build started: Project: IntegrationTestBuildProject, Configuration: Debug Any CPU ------
27>PrepareTests -> D:\github\roslyn\artifacts\bin\PrepareTests\Debug\net8.0\PrepareTests.dll
27>Roslyn.VisualStudio.Setup.Dependencies -> D:\github\roslyn\artifacts\bin\Roslyn.VisualStudio.Setup.Dependencies\Debug\net472\Roslyn.VisualStudio.Setup.Dependencies.dll
27>Roslyn.VisualStudio.Setup.Dependencies -> D:\github\roslyn\artifacts\VSSetup\Debug\Roslyn.VisualStudio.Setup.Dependencies.vsix
27>VisualStudio.SetupPackage -> D:\github\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Compilers.Setup.x64\Debug\net472\Microsoft.CodeAnalysis.Compilers.x64.vsix
27>VisualStudio.SetupPackage -> D:\github\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Compilers.Setup.arm64\Debug\net472\Microsoft.CodeAnalysis.Compilers.arm64.vsix
27>Roslyn.VisualStudio.DiagnosticsWindow -> D:\github\roslyn\artifacts\bin\Roslyn.VisualStudio.DiagnosticsWindow\Debug\net472\Roslyn.VisualStudio.DiagnosticsWindow.dll
27>RunTests -> D:\github\roslyn\artifacts\bin\RunTests\Debug\net8.0\RunTests.dll
27>Roslyn.VisualStudio.DiagnosticsWindow -> D:\github\roslyn\artifacts\VSSetup\Debug\Roslyn.VisualStudio.DiagnosticsWindow.vsix
27>VisualStudio.SetupPackage -> D:\github\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Compilers.Setup.x86\Debug\net472\Microsoft.CodeAnalysis.Compilers.x86.vsix
27>Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests -> D:\github\roslyn\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Debug\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll
27>Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests -> D:\github\roslyn\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Debug\net8.0\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll
========== Build: 23 succeeded, 4 failed, 180 up-to-date, 0 skipped ==========
========== Build completed at 11:10 AM and took 26.628 seconds ==========
Visual Studio accelerated 1 project(s), copying 4 file(s). See https://aka.ms/vs-build-acceleration.

full log is at: https://gist.github.com/CyrusNajmabadi/6f17341a7ce5c2aa3cb651aa274b3b17

Cosifne commented 1 week ago

Fixed in https://github.com/dotnet/roslyn/pull/74205 https://github.com/dotnet/roslyn/pull/74486