Skip to content

[One .NET] build solution in parallel can cause <Csc/> to trip on itself #5280

Closed
@jonathanpeppers

Description

@jonathanpeppers

Happened in a test here:

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4207466&view=ms.vss-test-web.build-test-results-tab&runId=16884872&resultId=100115&paneView=attachments

                   "C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\SolutionBuildSeveralProjects.sln" (Build target) (1:2) ->
                   "C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\App2\App2.csproj" (default target) (13:6) ->
                   "C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\App2\App2.csproj" (_ComputeFilesToPublishForRuntimeIdentifiers target) (13:7) ->
                   "C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\Lib0\Lib0.csproj" (default target) (12:20) ->
                   (CoreCompile target) -> 
                     CSC : error CS2012: Cannot open 'C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\Lib0\obj\Debug\Lib0.dll' for writing -- 'The process cannot access the file 'C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\Lib0\obj\Debug\Lib0.dll' because it is being used by another process.' [C:\a\1\s\bin\TestRelease\temp\SolutionBuildSeveralProjects\Lib0\Lib0.csproj]

    0 Warning(s)
    1 Error(s)

It looks like App1 and App2 both reference Lib0. For some reason building a solution file with -m can cause Lib0.dll to be written by two instances of <Csc/> at the same time.

Binlog: msbuild.zip

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions