开发者

How do I customize the namespace in code generated by protobuf-net

开发者 https://www.devze.com 2023-02-01 05:40 出处:网络
I have a proto file as follows import \"protobuf_net.proto\"; option (protobuf_net.namespace) = \"My.Test\";

I have a proto file as follows

import "protobuf_net.proto";
option (protobuf_net.namespace) = "My.Test";

enum TestEnum {
    FIRST = 0;
    SECOND = 1;
    THIRD = 2;
}

I'm expecting the resulting TestEnum to be in the My.Test namespace, but the namespace开发者_如何学运维 is just the name of the file (or a package if I define one). Any suggestions as to what I'm doing wrong?


From memory, this uses the existing proto syntax

package My.Test {
     enum TestEnum {
        FIRST = 0;
        SECOND = 1;
        THIRD = 2;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消