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

Flow transitive build targets for project references #352

Merged
merged 3 commits into from
Jun 25, 2019
Merged

Flow transitive build targets for project references #352

merged 3 commits into from
Jun 25, 2019

Conversation

JunTaoLuo
Copy link
Contributor

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.

Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd like to understand better why the PrivateAssets=None doesn't work.
Should we file an issue to investigate and remove the workaround once possible?

@JunTaoLuo
Copy link
Contributor Author

JunTaoLuo commented Jun 25, 2019

Actually, it seems like the results of pack were being cached. PrivateAssets seems to work on a clean build. Will update PR.

I thought pack was also affected by dotnet/sdk#952 but upon closer inspection that's a totally unrelated issue.

@JunTaoLuo JunTaoLuo merged commit 0fb9708 into grpc:master Jun 25, 2019
@JunTaoLuo JunTaoLuo deleted the johluo/transitive-client-props branch June 25, 2019 21:22
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