在protobuf-csharp-port 2.4.1.473中重建AddressBook示例

时间:2012-08-15 08:25:53

标签: c# .net protocol-buffers

我已经在protobuf-csharp-port-2.4.1.473-source中成功构建了示例AddressBook项目,甚至可以使用protobuf-2.4.1-win32中的C ++示例。但是,当我尝试重新生成AddressBookProtos.cs文件并执行它时,我遇到了以下运行时问题。

Options:
L: List contents
A: Add new person
Q: Quit
Action? a
Exception executing action: System.TypeInitializationException: The type initializer
for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBook' threw an exception. ---> 
System.TypeInitializationException: The type initializer
for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos' threw an exception. --->
System.ArgumentException: Invalid embedded descriptor for "tutorial/addressbook.proto". --->
Google.ProtocolBuffers.Descriptors.DescriptorValidationException: tutorial/addressbook.proto:
Dependencies passed to FileDescriptor.BuildFrom() don't match those listed in the
FileDescriptorProto.
at Google.ProtocolBuffers.Descriptors.FileDescriptor.BuildFrom(FileDescriptorProto proto,
FileDescriptor[] dependencies)
at Google.ProtocolBuffers.Descriptors.FileDescriptor.InternalBuildGeneratedFileFrom(Byte[]
descriptorData, FileDescriptor[] dependencies, InternalDescriptorAssigner descriptorAssigner)

我尝试使用protos \ tutorial \ addressbook.proto从protobuf-csharp-port-2.4.1.473-release-binaries生成AddressBookProtos.cs,但似乎缺少命名空间和umbrella_classname选项。此外,protobuf-csharp-port-2.4.1.473-source中的src \ AddressBook \ AddressBookProtos.cs中列出的版本号表示它是“2.3.0.277”。

0 个答案:

没有答案
相关问题