question

Reze-2966 avatar image
0 Votes"
Reze-2966 asked Reze-2966 commented

VS 2019 and Grpc Build failed without show any error

Hello, I was trying Grpc and I made a Service that is working. Then I made a Console App as client and it works Ok. Then a Winforms App that work too. When I made a WPF App, when I built it says 'Build Failed' but there are no errors in the 'Error Tab'. The first line compiles well: using var channel = GrpcChannel.ForAddress("https://localhost:5001"); But when I uncoment the second line give me that strange error: var weather = new Greeter.GreeterClient(channel); Anyone knows what is wrong? I'm using .Net 5.0. Thanks!
81168-sem-nome.png

dotnet-csharpwindows-wpf
sem-nome.png (17.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Reze-2966
Could you check the Output Window to see if there is any error message? What is your strange error? I cannot give an accurate analysis according to your description. Could you please give me the relevant code snippet to make a sample to reproduce your error?

0 Votes 0 ·

Made a snippet for test. Use proto from Template.


  • VS 2019, V16.9.2
    • Google.Protobuf 3.15.6

    • GRPC.Net.Client 2.36.0

    • GRPC.Tools 2.36.4

If you uncomment line var greeter = new Greeter.GreeterClient(channel); it doesn't compile but give you no errors.

 - VS 2019, V16.9.2
  - Google.Protobuf 3.15.6
  - GRPC.Net.Client 2.36.0
  - GRPC.Tools 2.36.4
    
 If you uncomment line **var greeter = new Greeter.GreeterClient(channel);** it doesn't compile but give you no errors.
    
     public MainWindow()
             {
                 InitializeComponent();
        
                 using var channel = GrpcChannel.ForAddress("https://localhost:5001");
                 var greeter = new Greeter.GreeterClient(channel);
             }
        
           <ItemGroup>
             <Protobuf Include="Protos\greet.proto" GrpcServices="Client" />
           </ItemGroup>



0 Votes 0 ·

0 Answers