-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf 使用枚举报错 #109
Comments
请提供FieldDescriptorProto |
没事了,我晚上测试 |
@JasonXuDeveloper 就是工程里面test.cs里的 |
@JasonXuDeveloper 静待佳音 |
然后你这个enum必须定义为int类型,例如: enum Test
{
a,
b,
c
}
enum Test: System.Int32之类的
{
a,
b,
c
}
或者 |
@JasonXuDeveloper FieldDescriptorProto消息是工程里面test.proto这个文件用工程提供的toCS工具生成的。。因为发现没法用枚举,所以看这个消息里面有个枚举就直接用这个写了测试代码来进行测试。。 |
哦哦 我做一个看看 |
找到问题了,你那个生成的type有个lable属性是nullable,ILRuntime不支持,而且你为null了protobuf无法去序列化 |
不是的,,我是ILruntime里用的,报错是说的ILruntime的类型没法装换为枚举,这个Label可以删了的,不影响,有个枚举就行 |
我知道,我的意思是这个枚举也是null,没办法处理啊 |
然后我会把enum转换这边修复的 |
已修复,明早提交到分支 |
@JasonXuDeveloper thank you 我明天更新看看 |
马上提交,然后test.cs的那个类改一下,ilruntime不支持nullable
|
测试代码如下
报错如下
The text was updated successfully, but these errors were encountered: