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.11k stars 4.04k forks source link

The IDE locks files generated by source generators causing command line build to fail #50699

Closed tmat closed 1 year ago

tmat commented 3 years ago

Version Used:

Version 16.9.0 Preview 4.0 [30920.304.main]

Steps to Reproduce:

  1. Open Roslyn.sln in VS
  2. Build from command line.

Expected Behavior:

Actual Behavior:

CSC : error CS0016: Could not write to output file 'D:\R3\src\Compilers\CSharp\Portable\Generated\CSharpSyntaxGenerator\CSharpSyntaxGenerator.SourceGenerator\Syntax.xml.Internal.Generated.cs' -- 
'The requested operation cannot be performed on a file with a user-mapped section open. [D:\R3\src\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj]
jasonmalinowski commented 2 years ago

This is a really old bug and I haven't seen this myself while dogfooding, so closing until further notice.

CyrusNajmabadi commented 1 year ago

Closing as per jason's comment.