Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3271568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:44:27+00:00 2026-05-17T18:44:27+00:00

I have the following struct: public struct Declarations { public const string SchemaVersion =

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:44:27+00:00Added an answer on May 17, 2026 at 6:44 pm

    Xml serializer serializes only properties.

    Wrap your variables.

    class Cro
    {
         public Cro
         {
              _atia="my const value";
         }
         private string _atia; // won't be serialized
         public string Atia //  will be serialized
         {
              get
              {
                   return _atia;
              }
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some generic types, like the following: public struct Tuple<T1, T2> { ...
I have the following use case, a struct with some boolean and int variables
I have following string String str = replace :) :) with some other string;
I have the following struct in C++: #define MAXCHARS 15 typedef struct { char
I have the following construction: typedef struct bucket { char *key; ENTRY *data; struct
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
Say I have the following C++: char *p = new char[cb]; SOME_STRUCT *pSS =
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following situation. A main table and many other tables linked together with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.