DNB5brims
DNB5brims

Reputation: 30618

gRPC build error using Visual Studio 2019 C#

enter image description here

I make my project based on this tutorial:

https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.1&tabs=visual-studio

It told me that it is missing directive or an assembly reference. But I instal the related plugin, and the code generate successfully, I don't know why VS still can't find the code... Here is the code content, the namespace is exist:

enter image description here

More info my proto properties: enter image description here

Error Msg:

1>MainWindow.xaml.cs(6,7,6,23): error CS0246: The type or namespace name 'HeartBeatMessage' could not be found (are you missing a using directive or an assembly reference?) 1>MainWindow.xaml.cs(16,24,16,40): error CS0246: The type or namespace name 'HeartBeatService' could not be found (are you missing a using directive or an assembly reference?)

Upvotes: 5

Views: 4032

Answers (1)

kgwong
kgwong

Reputation: 121

I found this question because I was running into this problem too. See: https://github.com/grpc/grpc/issues/20402

For now, I have manually moved the generated .cs files into my project and disabled the build step on the .proto (otherwise VS will complain about double definitions).

Upvotes: 3

Related Questions