Question about C# classes generated from a .xsd via xsd.exe in VS 2003

I have a schema that has been in existence over 1 year.  I have been making a few minor modifications to it recently and suddenly
the generated C# classes have made a radical change.

I have just compared the xsd source to the last compiled version on 8/25/06 and they are identical, yet the generated C# is
different.  I do not know enough about XSD and schemas to understand how the original output was generated, but I need to get it
back.

I am showing an excerpt from the schema and the old and new generated C# class.

	<xs:complexType name="ListenerItem">
		<xs:sequence>
			<xs:choice id="HostFormat">
				<xs:element name="HostName" type="mstns:FullyQualifiedNameType" />
				<xs:element name="HostAddress" type="mstns:IPAddressTypeV4" />
				<xs:element name="Any" type="xs:string" />
			</xs:choice>
			<xs:element ref="mstns:ClientType" />
			<xs:element name="HostPort" type="mstns:PortNumberType" />
			<xs:element name="NumThreads" type="xs:unsignedInt" />
			<xs:element name="InitialState" type="mstns:ListenerState" />
			<xs:element name="Name" type="xs:string" nillable="false"></xs:element>
			<xs:element name="AllowGenericStation" type="xs:boolean" nillable="false" default="false"></xs:element>
			<xs:element name="AllowClientSuppliedStation" type="xs:boolean" nillable="false" default="false" />
			<xs:element name="AllowHostLookup" type="xs:boolean" nillable="false" default="false" />
			<xs:element name="ClientVersion" type="mstns:ClientVersion" />
			<xs:element name="EncryptionRequirements" type="mstns:EncryptionEnum" />
			<xs:element name="AuthenicationRequirementsRequired" type="mstns:AuthenicationEnum" />
			<xs:element name="AuthenicationRequirementsAllowed" type="mstns:AuthenicationEnum" />
			<xs:element name="KeepAliveInterval" type="xs:unsignedInt" default="5" />
			<xs:element name="KeepAliveUnits" type="KeepAliveUnitsType" default="Minutes" />
		</xs:sequence>
	</xs:complexType>

OLD C# Code
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/XMLSchema.xsd")]
    public class ListenerItem {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("HostAddress", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("Any", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("HostName", typeof(string))]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
        public string Item;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public AddressTypeChoiceWithAny ItemElementName;				<------------ see this line below
        
        /// <remarks/>
        public ClientType ClientType;
.......

NEW C# Code
   [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/XMLSchema.xsd")]
    public class ListenerItem {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("HostAddress", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("Any", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("HostName", typeof(string))]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
        public string Item;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public ItemChoiceType1 ItemElementName;								<-------------- See type changed
        
        /// <remarks/>
        public ClientType ClientType;
.......

I would expect that most of you would say that I am crazy or that I have not been generating from the xsd that I though that I
had, but I have gone back in VSS for over the past year and that part of the schema has not changed and the generated C# has not
changed until today.

Could someone please tell me what to put into the schema to turn ItemChoiceType1 back to AddressTypeChoiceWithAny?

Thanks
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
0
roy1 (9)
9/12/2006 4:27:58 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
639 Views

Similar Articles

[PageSpeed] 59

"Roy Chastain" <roy@kmsys.com> wrote in message 
news:39ndg2tcmssgv3m0menmrvbtn70i2oeagr@4ax.com...
>I have a schema that has been in existence over 1 year.  I have been making 
>a few minor modifications to it recently and suddenly
> the generated C# classes have made a radical change.
>
...
> I would expect that most of you would say that I am crazy or that I have 
> not been generating from the xsd that I though that I
> had, but I have gone back in VSS for over the past year and that part of 
> the schema has not changed and the generated C# has not
> changed until today.

I see that you already know the answer to the question. Now, all you have to 
do is believe it and figure out how it happened.

Either:

1) If you don't change anything, but something changes anyway, then it's 
because something changed, possibly because you changed it.
2) If you change something, but the outputs don't change, then either you 
didn't change it, or you're looking at the wrong outputs.

But you already know this, you just prefer to think that something magical 
happened instead. It didn't. Get that clear in your mind, and you can begin 
to solve the real problem.

John

"Once you have elimintated the impossible, that which remains, no matter how 
unlikely, is the truth.", S. Holmes


0
John
9/12/2006 4:57:30 PM
Hi Roy,

The xsd.exe analyzes the whole schema and generates the class. A small 
change may result in a big change as John mentioned. Do you have any 
concern on the change of the generated class? If so, maybe we can find a 
workaround for that.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no 
rights.)

0
v-kevy (347)
9/13/2006 1:51:48 AM
Even though you havent changed the schema, did you upgrade your framework 
from .NET 1.0/1.1 to .NET 2.0?

Thanks,
Priya

"Roy Chastain" <roy@kmsys.com> wrote in message 
news:39ndg2tcmssgv3m0menmrvbtn70i2oeagr@4ax.com...
>I have a schema that has been in existence over 1 year.  I have been making 
>a few minor modifications to it recently and suddenly
> the generated C# classes have made a radical change.
>
> I have just compared the xsd source to the last compiled version on 
> 8/25/06 and they are identical, yet the generated C# is
> different.  I do not know enough about XSD and schemas to understand how 
> the original output was generated, but I need to get it
> back.
>
> I am showing an excerpt from the schema and the old and new generated C# 
> class.
>
> <xs:complexType name="ListenerItem">
> <xs:sequence>
> <xs:choice id="HostFormat">
> <xs:element name="HostName" type="mstns:FullyQualifiedNameType" />
> <xs:element name="HostAddress" type="mstns:IPAddressTypeV4" />
> <xs:element name="Any" type="xs:string" />
> </xs:choice>
> <xs:element ref="mstns:ClientType" />
> <xs:element name="HostPort" type="mstns:PortNumberType" />
> <xs:element name="NumThreads" type="xs:unsignedInt" />
> <xs:element name="InitialState" type="mstns:ListenerState" />
> <xs:element name="Name" type="xs:string" nillable="false"></xs:element>
> <xs:element name="AllowGenericStation" type="xs:boolean" nillable="false" 
> default="false"></xs:element>
> <xs:element name="AllowClientSuppliedStation" type="xs:boolean" 
> nillable="false" default="false" />
> <xs:element name="AllowHostLookup" type="xs:boolean" nillable="false" 
> default="false" />
> <xs:element name="ClientVersion" type="mstns:ClientVersion" />
> <xs:element name="EncryptionRequirements" type="mstns:EncryptionEnum" />
> <xs:element name="AuthenicationRequirementsRequired" 
> type="mstns:AuthenicationEnum" />
> <xs:element name="AuthenicationRequirementsAllowed" 
> type="mstns:AuthenicationEnum" />
> <xs:element name="KeepAliveInterval" type="xs:unsignedInt" default="5" />
> <xs:element name="KeepAliveUnits" type="KeepAliveUnitsType" 
> default="Minutes" />
> </xs:sequence>
> </xs:complexType>
>
> OLD C# Code
> 
> [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/XMLSchema.xsd")]
>    public class ListenerItem {
>
>        /// <remarks/>
>        [System.Xml.Serialization.XmlElementAttribute("HostAddress", 
> typeof(string))]
>        [System.Xml.Serialization.XmlElementAttribute("Any", 
> typeof(string))]
>        [System.Xml.Serialization.XmlElementAttribute("HostName", 
> typeof(string))]
> 
> [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
>        public string Item;
>
>        /// <remarks/>
>        [System.Xml.Serialization.XmlIgnoreAttribute()]
>        public AddressTypeChoiceWithAny ItemElementName; <------------ see 
> this line below
>
>        /// <remarks/>
>        public ClientType ClientType;
> ......
>
> NEW C# Code
> 
> [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/XMLSchema.xsd")]
>    public class ListenerItem {
>
>        /// <remarks/>
>        [System.Xml.Serialization.XmlElementAttribute("HostAddress", 
> typeof(string))]
>        [System.Xml.Serialization.XmlElementAttribute("Any", 
> typeof(string))]
>        [System.Xml.Serialization.XmlElementAttribute("HostName", 
> typeof(string))]
> 
> [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
>        public string Item;
>
>        /// <remarks/>
>        [System.Xml.Serialization.XmlIgnoreAttribute()]
>        public ItemChoiceType1 ItemElementName; <-------------- See type 
> changed
>
>        /// <remarks/>
>        public ClientType ClientType;
> ......
>
> I would expect that most of you would say that I am crazy or that I have 
> not been generating from the xsd that I though that I
> had, but I have gone back in VSS for over the past year and that part of 
> the schema has not changed and the generated C# has not
> changed until today.
>
> Could someone please tell me what to put into the schema to turn 
> ItemChoiceType1 back to AddressTypeChoiceWithAny?
>
> Thanks
> -------------------------------------------
> Roy Chastain
> KMSYS Worldwide, Inc.
> http://www.kmsys.com 


0
priyal1 (30)
9/13/2006 8:51:28 PM
Reply:

Similar Artilces:

Lansweeper on sbs 2003 premium
Got some people on the network with undesirable software on their workstations. Due to some crappy software that we need, I can not demote them to regular users on their machines. So I saw this software in the internet for free!!! Anybody has done this? any gotchas? Regards Miguel s�nchez "Miguel Sanchez" <santaki2@hotmail.com> wrote in message news:#M39t$YsKHA.4704@TK2MSFTNGP04.phx.gbl... > Got some people on the network with undesirable software on their > workstations. Due to some crappy software that we need, I can not demote > them to regula...

Need to Reset a Site Folder in Exchange 2003 Server... GUIDGEN.EXE Q
I need to reset a site folder using GUIDGEN.EXE because of an offline address book problem that I've been having, when people sync in Outlook: 10:07:25 Microsoft Exchange offline address book 10:07:25 0X8004010F Anyhow, I'm following the instructions here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q822444 And I'm a little worried about "When you create a new site folder, the data that was previously contained in the original site folder is lost." Will this blow away my public folders, and I'll lose the data? Does anyone have any experience they...

How to add a new Journal Type when using Outlook 2003 ?
In which field? See http://www.slipstick.com/journal/index.htm for some - and if we know which field, we can be more specific. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Join OneNote Tips mailing list: http://www.onenote-tips.net/ "Harold.Little@mail.house.gov" <harold.little@mail.house.gov> wrote ...

Outlook 2003
I'm setting up a machine for a friend he has Outlook.PST and Archive.PST on the disk. (total of 1.5 GB. I know about size. I'll teach him after we move in.) Do I export the files or do I copy the PST files directly and point to them? FWIW, it's all XP/Home and Outlook 2003. I've done a bunch of googling and reading of Usenet archives and I'm amazed how un-cookie-cutter moving email data to a new machine is. Circa Outlook 2000, I managed a thousand laptops and we copied PST files with ease and never a problem. I get different dignals, now. -- a d y k e s @ p a n i ...

Row Autofit problem Excel 2003
I wonder if anyone can reproduce the following: 1. Create a new Excel workbook, select cell A1 on sheet1. 2. In menu Format/Cells/Alignment select Vertical:Top and check Wrap Text. 3. In the formatting toolbar, select Font Verdana 10pt. 4. Type "This is my text" int the cell. It should wrap "my text" to the second line. 5. In menu Format / Row, select Autofit. 6. Preview or print the worksheet. The problem: About half of the bottom of the second line "my text" is cut off. I noticed two things: First, the problem occurs with any selection of the vertical ...

How can I remove ALL hyperlinks in a document in Excel 2003?
I would like to Remove ALL hyperlinks instead of one by one in Excel 2003 Sub DeleteHyperlinks() Dim Cell As Range For Each Cell In Intersect(Selection, _ Selection.SpecialCells(xlConstants, xlTextValues)) With ActiveSheet .Hyperlinks.Delete End With Next Cell End Sub Gord Dibben MS Excel MVP On Tue, 25 May 2010 08:04:01 -0700, ToBeFree71 <ToBeFree71@discussions.microsoft.com> wrote: >I would like to Remove ALL hyperlinks instead of one by one in Excel 2003 You don't need the loop. Sub DeleteHyperlinks()...

Combo box list question
I want to resize the width of the drop down list of a combo box in excel. When i try to change the values in the combo box> properties> listwidth, it gives wierd results. I have tried putting diff values in the columnwidth but I cannot figure out what works. Is there a bug in this function? I will appreciate any response. Thanks Hi The ColumnWidth property of a combo box accepts values in Points (default), Inches or Centimeters. 72 points =1 in HTH Cordially Pascal "tanner g" <noname@dumpster.org> a �crit dans le message de news: Xns963F15BC8A0E81iq9hhf7rhf888s...

Question about upsizing to SQL Server
Hi I want to upzise my db to SQL Server 2005 and have a question about differences in datatypes. My PM datatype fields in Access, will it be nText or nVarcharMax in SQL Server, what is the difference between them? Mattias Mattias You didn't indicate what type the field is in Access... Regards Jeff Boyce Microsoft Office/Access MVP "Mattias" <Mattias@discussions.microsoft.com> wrote in message news:5606D467-017D-4F3F-A62D-A2C44C912A98@microsoft.com... > Hi > > I want to upzise my db to SQL Server 2005 and have a question about > differences in datatype...

Excel 2003 Gets Slow
Hello, I have been using Excel 2003 for about 6 months now, i have been experiencing a problem that is getting worst as days go by, my problem is that when ever i open excel and work continiously i'm ok but as soon as i walk away for about ten minutes or so and i leave excel open with what ever i was working on it just sits there for abou five minutes or so to close and i have to reboot my machine to get back to normal. Any suggestions. Henry ...

Problem in changing formula-generated values in the chart in Micro
Hi all, I am facing a problem in changing formula-generated values in the chart in Microsoft 2007. Actually I am having a simple 2D line graph and I want to change values that are generated from worksheet formulas in 2-D line chart by dragging the data marker in the chart. But when I am trying to drag the data marker to a new position in the chart it is not allowing me to do in Microsoft 2007. I am able to move the data marker to a new position in Microsoft 2003 but not in Microsoft 2007. Please help me out by resolving this issue. Expecting a quick reply from your side. Thanks and Rega...

CSocket Question
Hello all. I'm creating a basic chat application using MFC and wish to know how to setup my application. My question is on whether i should have two CMySocket, which is derived from CSocket, or just the one. Also I want my Server/Client application to be able to both receive and send data at any time. I have made the following function calls 1. CMySocket * m_pSocket = new CMySocket; 2. m_pSocket->Create() 3. m_pSocket->Listen() // ready to accept incoming transmissions .... then in a separate handler i make the following function calls 4. m_pSocket->Create() 5. m_pSocket-&...

Question #2
Is there a way to use the sumif function in regards to a cell's format? For example, I want to sum all cells that are filled in red. Hi Tom! Try a visit to Chip Pearson's site for this issue: Chip Pearson: http://www.cpearson.com/excel/colors.htm Here's an extract that covers what you want: Start Extract>> The following function will return the sum of cells in a range that have either an Interior (background) or Font of a specified color. InRange is the range of cells to examine, WhatColorIndex is the ColorIndex value to count, and OfText indicates whether to return ...

OL 2003- Impact of Reorganizing Folders on Archived Files
I had to do a complete XP Pro Sp3 a while back and when I reinstalled OL 2003 the previous arhive files were lost (or actually I probably didn't reinstall OL correctly). Anyway I need to reorganize my personal folders and have waited to setup new archives until that task was completed but it is an ongoing process. So my question is if I go ahead and setup archiving now, what is the impact on the archived file when I make changes to the folder organization? Hope this question makes sense and thanks in advance .... If you're using AutoArchive, your mails get archived in ...

Error on using MS Access 2003
Hi, in my office, there is a backend database to store our data and a frontend database contains queries, tables, forms, macros and VB scripts that let the users use about 6 applications involving filter data, print documents, create or edit record, etc. However, in recently, the Access is down from one day to couple of days. The error can be divide into two types, some users can partially use the applications; some users cannot open the Access database template; and some users can work normally. There are about 30-40 users to use this Access Tempate (frontend) application and this i...

Using Exchange 2003 Deployment Tools (incl. ADC) for 2000 upgrade
After researching and testing various migration strategies for upgrading our organization from Exchange 5.5 on Win2k to Exchange 2003 on Win2k, it seems that the best method will be to first upgrade our various sites to Exchange 2000, then consolidate the users to a fewer number of Exchange 2003 servers. I'm interested in getting feedback on this strategy. I'll explain our situation further We have 21 sites in our Exchange organization, one each per regional office (though some offices do not have an Exchange server). Given that we only have 450 users in our org, we want to consolidat...

Outlook 2003 and Exchange 2003 #2
After setting up terminal services and a VPN connection on my exchange server, Outlook 2003 was no longer able to make a connection. I think that it may be an issue with dual NIC's, but I'm not sure. I disabled one NIC and I still got the same results. I am able to connect using OWA. ...

calling modal dialog function from external c code
Howdy all, Problem: I have a dialog based MFC app, mixed in with some external C code, and want to be able to have a C callback function interact with the dialog. Something along the lines of: void MyAppDlg::OnTest() { m_ctlStaticText.SetWindowText("hello world"); } void appCallback(int msg) { switch(msg) { case FOO: // invoke MyAppDlg::OnTest here break; } } My first attempt was to try and get at the dialog directly: case FOO: ((MyAppDlg)theApp.m_pMainWnd).OnTest(); break; The result was an...

OleDB and Access Problem in C# (.NET Framework 2.0)
Hi, Is there a known issue in using Access through OleDB provider in C# (.NET Framework 2.0) where inserted records are not reflected in subsequent queries. Worst still, if the PK is a auto number an exception is thrown. Please be good enough to point me to some resources on resolving this error. Please be good enough to reply. If anybody else has faced this same problem let me know. Thanks in advance! Best regards, Suminda Sirinath Salpitikorala Dharmasena sirinath wrote: > Hi, > > Is there a known issue in using Access through OleDB provider in C# > (.NET Framework 2.0) whe...

Exchange 2003 and Windows 2003 x64
Can Exchange 2003 Enterprise run fine on Windows 2003 x64. Thanks No, Exchange Server 2003 will not run on Windows Server 2003 for x64 - it needs the 32-bit OS. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: exchangepedia.com/blog ---------------------------------------------- "Mark Olczyk" <mark.olczyk@lwtc.edu> wrote in message news:%23lsqUCWSHHA.4672@TK2MSFTNGP03.phx.gbl... > Can Exchange 2003 Enterprise run fine on Windows 2003 x64. > > Thanks ...

how to add sound to a web site using publisher 2003
I need help. What can I do to add sound track to my site, at Publisher 2003? Had tried mp3. midi, wav. But it doesn1t work. Can someone help me? Soso wrote: > I need help. > What can I do to add sound track to my site, at Publisher 2003? Had > tried mp3. midi, wav. But it doesn1t work. Can someone help me? =================================== I guess you know that most surfers really hate it when they access a website and music begins to play? Anyway...for MS Publisher Web Design info go to: "Publisher Web Design" http://tinyurl.com/hnslm BTW, be sure to include your MS ...

Publisher 2003 #36
I can't get my submit button to work on a Publisher 2003 website I've created. I get an webbot-self error. Any suggestions are welcome! ...

#Name! error in 97-2003 workbook with external add-in formulas (Excel 2007)
I have a spreadsheet which is populated with a third-party add-in called Baseline which introduces a number of custom formula options for pulling market information into a local spreadsheet. That spreadsheet can be opened by Excel 2003 users (without the Baseline addin installed) as long as they do not update links; there are no #name errors in the workbook. However, I can't open the same spreadsheet in 2007 (again, no baseline addin installed) without getting the #Name error anywhere a baseline function had populated the spreadsheet. I am using Excel 2007 in compatibility mode. There see...

AVERAGE question #2
In Column B I have numbers entered on a daily basis. I would like to see the weekly average of those numbers in column D. Thanks in advance, Dave Horne In Column D enter: =AVERAGE(B1:B7) =AVERAGE(B8:B14) =AVERAGE(B15:B21) and continue down as far as you need. -- Gary''s Student - gsnu2007k "Dave Horne" wrote: > In Column B I have numbers entered on a daily basis. I would like to see > the weekly average of those numbers in column D. > > Thanks in advance, Dave Horne > > > Hi Dave, You need to post a lot more information. Is it one num...

Help with PowerPoint 2003 bullet levels
I have set up master slide text autolayout as follows: Level one, no bullet or indent .. Level two, bullet with indent - Level three, bullet with indent Here is the problem: After I type text in the first bullet level and press enter to start a new paragraph, the tab key no longer works to change the new paragraph to level two - have to use the outline arrows. I've experimented and it looks like the tab will only function right if level one has a bullet. I've experimented with inserting an "invisible" bullet in level one and reducing it in size as far as...

outlook 2003 stops responding (hang) when you click reply to all
i have received a mail, when i click to reply to all outlook 2003 hang/stops responding regards richard ...