Skip to content

ExcludeAssets="compile" has no effect on ProjectReference. #47403

Closed as not planned
@teo-tsirpanis

Description

@teo-tsirpanis

Describe the bug

I have a project that depends on another project at runtime, but must not reference it at compile time. In order to achieve this, I tried adding an ExcludeAssets="compile" metadata to the ProjectReference, but it had no effect and the second project was visible to the compiler.

To Reproduce

Build this solution. It should fail with a compile error but it does not.

Exceptions (if any)

Further technical details

Using .NET SDK 9.0.200.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions