wpf: Build intermittently fails due to missing generated source files

  • .NET Core Version: Version: 3.0.0-preview7-27902-19
  • Windows version: 18362.239

Problem description: We’ve been intermittently hitting build failures in recent builds due to files usually generated by the XAML compiler missing. It will fail one time and immediately succeed next build and then won’t fail against for a couple of hours. Multiple folks have started hitting it.

I happened to capture a failure under a build log.

Actual behavior:

CSC : error CS2001: Source file 'C:\project-system\artifacts\Debug\obj\Microsoft.VisualStudio.ProjectSystem.Managed.VS\ProjectSystem\VS\PropertyPages\GetProfileNameDialog.g.cs' could not be found. [C:\project-system\src\Microsoft.VisualStudio.ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS_doj0ahs0_wpftmp.csproj]
CSC : error CS2001: Source file 'C:\project-system\artifacts\Debug\obj\Microsoft.VisualStudio.ProjectSystem.Managed.VS\ ProjectSystem\VS\PropertyPages\DebugPageControl.g.cs' could not be found. [C:\project-system\src\Microsoft.VisualStudio .ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS_doj0ahs0_wpftmp.csproj]

Expected behavior: No build failures.

Minimal repro: Build Log: Build.zip

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 15 (14 by maintainers)

Most upvoted comments

I reproed this issue with a procmon trace active, attached.

VS 2022 was running in the background while the solution was being built on the command line. You can indeed see here that various instances of msbuild are fighting over the file, sometimes deleting it out from under each other (Operation=SetDispositionInformationEx). I know that Msbuild pids 62288, 64916 were each one of VS’s /nodeReuse worker processes. I believe that pid 76804 was also a /nodeReuse worker that exited by the time I wrote this comment, and that 80324 was the command line instantiation.

ProcmonTrace1362.zip