Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track unexpected dependencies so we only report missing dependencies once #957

Closed
wants to merge 3 commits into from

Conversation

natidea
Copy link
Contributor

@natidea natidea commented Mar 8, 2017

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

@davkean
Copy link
Member

davkean commented Mar 8, 2017

Not clear how this error is actionable? I still don't know what it means.

@natidea
Copy link
Contributor Author

natidea commented Mar 8, 2017

It occurs at a point where we are raising package dependencies. If the dependency is missing from "libraries" then we cannot compute a canonical version (which is part of the package id). Alternative options are to silently ignore this dependency, or add the dependency with a guessed version (based on version range). The latter is what we were doing previously, but somewhere along the way this got changed because something was broken downstream.

Agree it is not actionable in general, and we did not know about the unload project scenario when this was changed. Thinking about it now, another option might be to add a fake package definition (to a package that doesn't exist), so it surfaces in the solution explorer as an unresolved package.

@natidea
Copy link
Contributor Author

natidea commented Mar 8, 2017

Closing in favor of finding a way to flag bad dependency in solution explorer.

@natidea natidea closed this Mar 8, 2017
@davkean
Copy link
Member

davkean commented Mar 8, 2017

This mostly happens in the case of a missing project reference, right? In which, we should be flagging the project reference, not a package reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants