Flow transitive build targets for project references #352
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.
Right now the build targets that override LiteClientBase is only included in Grpc.Net.Client. The packages that transitively depend on this package (such as Grpc.Net.ClientFactory) do not flow those targets so referencing them would lead to type missing errors at build time (since the override did not occur and the base class resolves to ClientBase instead).
Though it's documented at https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#project-to-project-references, PrivateAssets=All on a ProjectReference did not translate to a PrivateAssets=All in the nuspec during pack. As a fallback, I'm adding the override target to all packages that transitively reference Grpc.Net.Client. I've tested that this resolves the issue even when multiple of these packages are referenced together. Though it can be argued that users shouldn't do this, at least this doesn't lead to catastrophic failure.
I need to check with the nuget folks to see if there's a way to propagate the PrivateAssets settings on a project to project reference to the nuspec at pack time.