I have the following struct:
public struct Declarations
{
public const string SchemaVersion = "urn:ean.ucc:gdsn:2";
}
And the SchemaVersion is used by some XmlElements which are trying to be serialized like this:
[XmlElement(Type=typeof(SomeGarbage),ElementName="moreJunk",IsNullable=false,Form=XmlSchemaForm.Unqualified,Namespace=Declarations.SchemaVersion)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
public SomeType __someMember;
I'm getting the following error when I try to run sgen.exe on my dll:
Error 1 There was an error reflecting type 'BigHammer.CINParser.Messages.Declarations'
Error 2 The command ""C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force "C:\Users\mstoddard\teamserver_source\GDSN\CINParser\CINParser\bin\Debug\BigHammer.CINParser.dll"
" exited with code 1.
I tried making the struct a class, no help
I tried adding a default constructor, no help
Thoughts?
===Update===
It looks like Visual Studio was hiding some information, I have The same classes defined in two different CLR namespaces but not XML namespaces:
Error: There was an error reflecting type 'BigHammer.CINParser.Messages.Declarations'. - Types 'BigHammer.CINParser.Messages.Declarations' and 'BigHammer.CINParser.Messages.urn_ean_ucc_2.Declarations' both use the XML type name, 'Declarations',from namespace ''. Use XML attributes to specify a unique XML name and/or namespace for the type.