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

Grpc.Tools should hook CoreCompile instead of BeforeCompile for WPF compatibility #780

Closed
uecasm opened this issue Feb 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@uecasm
Copy link

uecasm commented Feb 19, 2020

Using Grpc.Tools 2.27.

Protobuf file generation does not work correctly in WPF; this is listed as a known issue for .NET Core but does also affect .NET Framework as well.

The problem is that Grpc.Tools is hooking into the wrong part of the build process -- in particular a part that does not get executed for a particular compilation step used by WPF.

See dotnet/wpf#810 (comment) for more info.

The suggested fix is to change _Protobuf_Compile_BeforeCsCompile to hook CoreCompile instead of BeforeCompile.

I have not checked if this resolves the issue with .NET Core as well, although I would assume so. Defining the extra property (as shown in the comment above) definitely does resolve it for .NET Framework, and changing the BeforeTargets should have the same effect, but I have not explicitly tested that either.

@uecasm uecasm added the bug Something isn't working label Feb 19, 2020
@uecasm
Copy link
Author

uecasm commented Feb 19, 2020

And now I have tested a patched nuget package which does just change the BeforeTargets from BeforeCompile to CoreCompile, and confirmed that this works for .NET Framework.

@JamesNK
Copy link
Member

JamesNK commented Feb 19, 2020

Please recreate this issue in https://github.com/grpc/grpc - Grpc.Tools is part of that repository.

@uecasm
Copy link
Author

uecasm commented Feb 19, 2020

Ok, done. (FWIW I posted it here due to #574.)

@uecasm uecasm closed this as completed Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants