Open vrelk-net opened 3 months ago
I strongly suspect this is due to record
now being a contextual keyword in C#.
My personal recommendation is that you rename all your messages and enums to follow more common proto conventions (where they're PascalCased) - I strongly suspect that would fix the issue.
Obviously it would be good for us to handle this anyway, but it may well end up being tricky in terms of compatibility. I'm unlikely to get to this any time soon, I'm afraid - I have higher priority work.
Yep. Changing record
to Record
in the protobuf file did fix it. Wouldn't this fall under the pascal case function? I'm not sure that's working properly (ex. public sealed partial class mac_address : pb::IMessage<mac_address>
), unless it's only intended to capitalize some of them (ex. namespace Location
and public static partial class LocationReflection
.
Location.cs.txt
Wouldn't this fall under the pascal case function?
The generator doesn't apply that to message names (or RPC names, IIRC) - only field names, package elements, and file names. It potentially could do, but I'm not sure whether it does in any other languages, and it would be a very breaking change to make it start doing so now.
What version of protobuf and what language are you using? Version:
OS: Ubuntu 22.04 (protoc), Windows 11 (Visual Studio)
What runtime / compiler are you using (e.g., python version or gcc version):
What did you do? Steps to reproduce the behavior:
./protoc --proto_path=../include --proto_path=central --csharp_out=out central/location.proto
Compiler errors
Along with the following errors that Visual Studio spits out in addition to the ones above.
generated Location.cs source location.proto