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

Add a public target to NuGet.targets that can be referenced using BeforeTargets #4634

Closed
emgarten opened this issue Feb 16, 2017 · 4 comments
Labels
Milestone

Comments

@emgarten
Copy link
Member

The public Restore target is called on the solution metaproj when restoring a solution. Within each project the top level target called is _GenerateRestoreProjectSpec

To allow users to perform tasks before and after restore NuGet.targets should add a public target that can be used with BeforeTargets and AfterTargets

The fix for this could be as simple as renaming _GenerateRestoreProjectSpec and adding a comment in NuGet.targets if we decide to stay with that target.

https://github.com/dotnet/cli/issues/5683

@dsplaisted
Copy link

Related to this, generating an error in a target that runs before _GenerateRestoreProjectSpec doesn't actually cause the restore operation to fail. I've filed #5309 for this.

@emgarten
Copy link
Member Author

This has been added with CollectPackageReferences

@ashmind
Copy link

ashmind commented Apr 1, 2018

This has been added with CollectPackageReferences

Does this mean we need to attach to CollectPackageReferences instead of Restore, or just that it was implemented together with CollectPackageReferences?

@nkolev92
Copy link
Member

nkolev92 commented Apr 2, 2018

@ashmind
Attach to CollectPackageReferences.
In the solution case, restore is run on a metaproj, so the restore target can't be used as an extension point for projects.

Additionally, it's the only target that's consistent among VS and commandline for restore.

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

No branches or pull requests

5 participants