-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Protoc generates faulty C# namespace #13482
Comments
Please could you post your specific .proto file? (It's not clear what you mean by "namespace" here - protobuf package, or csharp_namespace option. If you want a specific C# namespace, the simple fix would be to specify it explicitly.) |
Hello, i mean package in proto file, e.g.: package my.scope._3 in C#: namespace my.scope.3 the underscore gets removed which does not work in C#. |
Right. I'd expect that to actually be modified to I would suggest you just use an explicit namespace option for the moment, which will allow you to avoid both the capitalization and the underscore removal: option csharp_namespace = "my.scope._3"; I'd expect that to work fine. |
Thank you for the suggestion, i will try it out as a workaround. However it’s not the best solution as we have to modify and scan the delivered 3rd party proto files |
Hopefully I'll be able to fix this at some point, but given that Protobuf isn't my main work and there is a workaround (which isn't true for some issues in the C# space), it's likely that it'll be a while before I get to this. If you were to contribute a PR that fixes this, that would be likely to speed things up. |
I will try to do a PR based on the fix that has already been made |
here is the PR: #13504 |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We still intend to address this, but it's unlikely to be in 2023 due to higher-priority issues. |
(#13504 is merged, so presumably this is at least better than it was - but I believe there are still improvements we want to make.) |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it. This issue was closed and archived because there has been no new activity in the 14 days since the |
Hello,
i'm not sure if this is a bug or how to fix this, haven't found anything on the internet.
We have a package like "my.name.space._3".
This works in protobuf and java generated code.
However in C# generated code the unserscore gets removed, and then the C# Compiler tells an error about that namespace "my.name.space.3".
Seems like only having a number in the namespace in C# is not working.
So how to handle this issue ? And we cannot change the protobuf files, since they are delivered by 3rd party.
C:\protoc --version
libprotoc 24.0
actually it should have been fixed: #10268
Thanks for help,
Nick
The text was updated successfully, but these errors were encountered: