mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
215 stars 26 forks source link

Properties referenced in Directory.Build.targets marked as unused in csproj #177

Open sammallon opened 5 months ago

sammallon commented 5 months ago

When a property defined in a csproj is referenced in the Directory.Build.targets file, it still gets marked as unused in the csproj.

As this is the opposite direction of the problem in #169, and it sounds like it should be a simpler fix, creating as a separate item for tracking. Please feel free to close as a duplicate if it fits well enough in another ticket.

csproj defining the property: image

Directory.build.targets referencing the property: image

In case it matters, the Directory.Build.targets file is up a few folders in the hierarchy, with intermediate Directory.Build.targets that import the Directory.Build.targets files above: image

mhutch commented 5 months ago

Yes, I think this one should work under the current model. I'll take a look at reproducing it.

Bertk commented 5 months ago

Hi, I just used dotnet Arcade with the great tool and had similar results.

image

global.json is also involved.

property MicrosoftBuildUtilitiesCoreVersion resolution:

  1. Directory.Build.props
  2. Sdk.props
  3. settings.props
  4. Versions.props