Skip to content

Intermediate outputs don't honor ArtifactsProjectName property when using artifacts output layout #53052

@DamianEdwards

Description

@DamianEdwards

Intermediate outputs don't appear to honor the <ArtifactsProjectName> property when using artifacts output layout. If multiple projects in the repo have the same name and the ArtifactsProjectName property is used to ensure their outputs don't collide, the bin outputs are separated accordingly, but the obj outputs are not. This leads to errors in commands like dotnet restore if the projects target separate TFMs.

I found this with a layout like the following:

/
  artifacts/
    bin/
      SourceGenerator/
        debug/
          SourceGenerator.dll
      SourceGenerator.Tests/
        debug/
          SourceGenerator.Tests.dll
    obj/
      SourceGenerator/  <-- Intermediate outputs from both projects going in here
        debug/
        project.assets.json
  src/
    SourceGenerator/
      SourceGenerator.cs
      SourceGenerator.csproj
  tests/
    SourceGenerator/
      SomeTests.cs
      SourceGenerator.csproj
        <AssemblyName>SourceGenerator.Tests</AssemblyName>
        <RootNamespace>SourceGenerator.Tests</RootNamespace>
        <ArtifactsProjectName>SourceGenerator.Tests</ArtifactsProjectName>

Related #51110

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions