On Oct 28, 12:04 am, honce <[EMAIL PROTECTED]> wrote:
> We are looking at the dotnet-protobufs for a new and are unable to
> build the generated C# code. I downloaded the latest code out of git
> and have been successful in building a C# file.
>
> We have been running:
> protoc -operson.bin person.proto
> protogen person.bin
>
> We add person.cs to our solution and rebuild with VS2008sp1 targeted
> for .Net 3.5sp1 on WinXP sp3. We then get the following error:
> Person.cs(7,29): error CS0441: 'Person': a class cannot be both static
> and sealed
>
> Any suggestions on what we're doing wrong?

Got it - the problem here is that it's generating a Person type as the
"umbrella" class, and also Person as the message.

You could either specify the name of the umbrella class as an option,
or just rename person.proto to (say) person_protofile.proto. It would
then create PersonProtoFile.cs with a PersonProtoFile umbrella class,
and a Person class for the Person message. The resulting file
definitely does compile :)

I'll try to remember to add a check for that situation - I suspect I
won't be able to catch everything like that, but I'll do what I can.

Jon



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to