DerrickBrayanClayton / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

import and enum statements using protogen-217 #33

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
email: dshrader38@gmail.com

What steps will reproduce the problem?
1. I create 2 .proto's (see attached files) loosely taken from the Google
tutorial: http://code.google.com/apis/protocolbuffers/docs/cpptutorial.html

2. I "proto" compile using the following protogen syntax
protogen.exe -i:Person.proto -o:..\dotnet\Person.cs
protogen.exe -i:AddressBook.proto -o:..\dotnet\AddressBook.cs

3. I "compile" a dotnet class library using the 2 generated .cs files (see
attached dotnet.zip for the complete .NET project). I'm using Microsoft
Visual C# 2005 (Version 8.0.50727.762)

What is the expected output? What do you see instead?
A tutorial.dll should be created. I am either doing something incorrectly
(hopefully!) or protogen does not handle "enum" and "import" correctly. If
the former is true, I apologize - and what I am doing wrong?

The message definitions are duplicated. I get a compile error:
The type 'tutorial.Person' already contains a definition for 'PhoneType'

What version of the product are you using? On what operating system?
r217

Please provide any additional information below.
I use the same sample to compile C++ using Google's protoc.exe. I create a
static library using Microsoft C++ 2005 and everything works OK. Same with
compiling Java. Both languages create the correct import/include statements
within the auto-generated source.

Original issue reported on code.google.com by dshrade...@gmail.com on 26 Nov 2008 at 10:56

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for reporting this - I will investigate.

The "protogen" stuff is fairly new to protobuf-net, so I haven't worked all the 
kinks 
out yet (my main focus was on getting a solid runtime first).

I'll get back to you soon.

Marc

Original comment by marc.gravell on 27 Nov 2008 at 6:46

GoogleCodeExporter commented 8 years ago
"import" is not working for me.  My app has grown to having lots of .proto 
files, and
I have just come against this limitation where I need to reference a message in
another .proto file.

Original comment by stuor...@gmail.com on 27 Nov 2009 at 1:10

GoogleCodeExporter commented 8 years ago
@stuorguk - can you indicate which build you are using? I can try to 
investigate, but 
it may be hard to reproduce without a sample. AFAIK it works OK (I'll check 
later).

Original comment by marc.gravell on 27 Nov 2009 at 1:20

GoogleCodeExporter commented 8 years ago
Sorry Marc, it is working.  A fault my end fitted the above description which
prematurely ended my search for a solution.

Original comment by stuor...@gmail.com on 27 Nov 2009 at 3:41

GoogleCodeExporter commented 8 years ago
OK; no problem

Original comment by marc.gravell on 27 Nov 2009 at 3:50