Track unexpected dependencies so we only report missing dependencies once #957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially addresses NuGet/Home#4724
(Part of series in dotnet/project-system#1660)
An error about unexpected dependencies is reported by the SDK when a project is unloaded (and in other situations that result in a dependency that does not appear in the asset file's "library" section).
Long term, we should move this validation of the assets file to the NuGet client, and add any problems found to project.assets.json from whence it can be raised to an MSBuild error by this SDK task (as requested in NuGet/Home#1599).
But this is a minor change to clean up this error so it is only reported once per project, removing all the duplicate errors reported in NuGet/Home#4724. (Also reworded the error since it has nothing to do with missing version numbers.)
/cc @davkean @nguerrera @dsplaisted @dotnet/project-system
/cc @emgarten as fyi