Closed GoogleCodeExporter closed 9 years ago
Can you attach the generated file to this issue? It *should* contain using
directives at the start, like this:
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
(I copied that directly from the generated CSharpOptions at
https://code.google.com/p/protobuf-csharp-port/source/browse/src/ProtocolBuffers
/DescriptorProtos/CSharpOptions.cs)
Original comment by jonathan.skeet
on 5 Mar 2014 at 8:50
Sorry, I can't share the file (need agreement from my company).
I've got the header :
// Generated by ProtoGen, Version=2.4.1.521, Culture=neutral,
PublicKeyToken=55f7125234beb589. DO NOT EDIT!
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace squarion_msg {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Squarion {
...
I'm a newbe in .Net (my first week). So may be I did something wrong.
An other info, if I change the namespace (eg s/quarion/ample/g), the error
gone. I've got some regular .cs in the same namespace (but not the same
directory) like Encoder.cs, MessageFactory.cs
Original comment by david.bernard.31
on 5 Mar 2014 at 9:16
If that's at the start of the file, you shouldn't be getting the message you're
getting - at least not in that file.
Do you have both a class called "pb" anywhere at all? Or a class called
squarion_msg anywhere? (It's a bad idea to give a class the same name as a
namespace, and it's possible that could cause the problem you're seeing.)
If you can't post the *actual* proto file or generated code, can you come up
with a sample which *does* cause the same problem? (Typically start with a copy
of the failing version, and remove as much as you can while making sure the
problem still occurs, then rename anything you need to for confidentiality. You
should end up with a very small sample.)
Original comment by jonathan.skeet
on 5 Mar 2014 at 9:22
No classes with the name 'pb', or squarion_msg or Squarion (except the one
generated).
No symbol 'pb' in the non-genereted .cs
I already try without success to isolate and reproduce with addressbook or with
a copy of my .proto in another namespace.
I can send you privately the .cs, but I just try to create an empty project
with a copy of the generated file, and there is no build error, but in the
editor 'pb::GeneratedMessageLite' with GeneratedMessageLite in red ('Unknown
Resolve Error').
Thanks for your time and help. Now we've got 2 workaround, search and replace
pb or using another namespace.
Original comment by david.bernard.31
on 5 Mar 2014 at 9:38
Okay - it sounds like it may be a Monodevelop issue, particularly if starting
again doesn't even give the same build error :(
Will leave as "WontFix" at the moment as there's not a lot we can do without a
way of reproducing, but I'll remember it for if this comes up again.
Original comment by jonathan.skeet
on 5 Mar 2014 at 9:47
Original issue reported on code.google.com by
david.bernard.31
on 5 Mar 2014 at 8:47