MSBuildSdks icon indicating copy to clipboard operation
MSBuildSdks copied to clipboard

[NoTargets] Projects referencing a NoTargets project do not see ResolvedProjectReference items

Open drewnoakes opened this issue 2 years ago • 2 comments

In VS, the dependencies tree relies on the design-time build producing resolved items for a projects references in order to display them as resolved in the tree.

When a project references a NoTargets project, it does not see such a resolved item and hence the yellow triangle in the dependencies tree in solution explorer remains visible:

image

The dependencies tree obtains these items from this target:

https://github.com/dotnet/project-system/blob/eb4e01a2d65fae7b0d466718356e7b9c5a175dcd/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DesignTimeTargets/Microsoft.Managed.DesignTime.targets#L389-L408

Something about the NoTargets project means that this reference is not handled by this target.

drewnoakes avatar Mar 09 '23 11:03 drewnoakes

Thanks for reporting @drewnoakes. Do you see anything obvious in the NoTargets logic that would be causing this?

https://github.com/microsoft/MSBuildSdks/tree/main/src/NoTargets/Sdk

jeffkl avatar Mar 09 '23 16:03 jeffkl

@jeffkl nothing jumps out at me. Diffing binlogs of a bare project with a single project reference to a NoTargets vs. a regular SDK project should reveal the issue. You might like to copy this target into the referencing project and ensure it's executed, then work back from there.

drewnoakes avatar Mar 15 '23 00:03 drewnoakes