Myservice.proto:7:xx: "google.protobuf.Empty" is not defined.

65 views
Skip to first unread message

Tom Hintz

unread,
Jan 5, 2021, 6:00:41 PM1/5/21
to Protocol Buffers
New user question... Using Visual Studio 2019, C# project, I added NuGet packages Google.Protobuf and Google.Protobuf.Tools and formed a simple. I can't use Empty or Timestamp data types.  How do I reference these definitions?  Example .proto file, below. protoc.exe version 3.14.0 produces the error:

Myservice.proto:7:xx: "google.protobuf.Empty" is not defined.

syntax = "proto3";
package Myservice;
option csharp_namespace = "Google.Protobuf.WellKnownTypes";

// Interface exported by the server.
service  Myservice   {
    rpc Mymethod(Msg) returns (google.protobuf.Empty);
}

message Msg { }

Derek Perez

unread,
Jan 5, 2021, 6:08:55 PM1/5/21
to Tom Hintz, Protocol Buffers
You need to locate and import this file locally:

That should do it!

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/a2569bda-59d4-4dc8-9fc6-543cc614eaa4n%40googlegroups.com.

Tom Hintz

unread,
Jan 5, 2021, 6:17:48 PM1/5/21
to Protocol Buffers
Thank you!
Reply all
Reply to author
Forward
0 new messages