dotnet / dotnet/sdk

Unable to build Solution that contains multi-targeted projects and using ArtifactsPath with IncludeProjectNameInArtifactsPaths set to false

Open
#45,513 6 comments 1 reaction 1 assignee Claimed by @dsplaisted View on GitHub
Area-NetSDK
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Description

I am trying to utilize the newest feature Simplified Artifacts Output. I want to exclude the project name from the path as to make it a more simplified structure. The issue is that when I do so and my solution contains a project that is multi-targeted it fails to add Multi-Targeted project frameworks to `project.assets.json`.

### Error
`
src\Artifacts\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project.
`

### `obj` folder structure

![Image](https://github.com/user-attachments/assets/1bd05e6e-8db9-44f4-9fcf-f91419d1a33e)

https://learn.microsoft.com/en-us/dotnet/core/sdk/artifacts-output

### Reproduction Steps

- Solution that contains .NET 8 projects and at least one project that is multi-target. For example NET 8 and netstandard2.0
- Add the following to `Directory.Build.props`

```

$(SolutionDir)Artifacts\
false

```

- Attempt to build project

### Configuration

- Solution is .NET 8.0
- A couple projects are .NET 8 - Windows
- A couple projects are multi-targeted (.NET 8 and netstandard2.0)
- Architecture is x64

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.