3

サンプル AddressBook プロジェクトを protobuf-csharp-port-2.4.1.473-source で正常にビルドし、さらに 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 を生成しようとしましたが、名前空間と傘のクラス名のオプションが欠落しているようです。また、protobuf-csharp-port-2.4.1.473-source に含まれる src\AddressBook\AddressBookProtos.cs に記載されているバージョン番号は、「2.3.0.277」です。

4

0 に答える 0