automatic generation on xsd modification

Aug 5, 2011 at 12:24 AM

Hi,

 

When I  follow this instruction "Xsd2Code has a CustomTool which allows automatic generation when schema is modified.". The Xsd2Code seems to generate duplicate classes and properties that's already been created in partial class (which got generated by "Run Xsd2Code Generation".

 

Is this a bug or am I doing anything wrong.

 

Thanks.

Aug 5, 2011 at 12:32 AM

Hi nkpun,

I had the same problem.

All I had to do was use different Namespaces for each Schema I was generating code for.

E.g.

Honeywell.Integration.Crs.Schemas.Schedule

Honeywell.Integration.Crs.Schemas.Schedule

This stopped clashing of duplicate class names.

Regards

Michael

From: nkpun [email removed]
Sent: Friday, 5 August 2011 10:24 AM
To: Minto, Michael
Subject: automatic generation on xsd modification [Xsd2Code:267825]

From: nkpun

Hi,

When I follow this instruction "Xsd2Code has a CustomTool which allows automatic generation when schema is modified.". The Xsd2Code seems to generate duplicate classes and properties that's already been created in partial class (which got generated by "Run Xsd2Code Generation".

Is this a bug or am I doing anything wrong.

Thanks.

Aug 5, 2011 at 12:53 AM

Sorry, I pasted the same namespace twice

Should have been:

Honeywell.Integration.Crs.Schemas.Schedule

Honeywell.Integration.Crs.Schemas.TrainList

Regards

Michael

From: Minto, Michael
Sent: Friday, 5 August 2011 10:30 AM
To: 'Xsd2Code@discussions.codeplex.com'
Subject: RE: automatic generation on xsd modification [Xsd2Code:267825]

Hi nkpun,

I had the same problem.

All I had to do was use different Namespaces for each Schema I was generating code for.

E.g.

Honeywell.Integration.Crs.Schemas.Schedule

Honeywell.Integration.Crs.Schemas.Schedule

This stopped clashing of duplicate class names.

Regards

Michael

From: nkpun [email removed]
Sent: Friday, 5 August 2011 10:24 AM
To: Minto, Michael
Subject: automatic generation on xsd modification [Xsd2Code:267825]

From: nkpun

Hi,

When I follow this instruction "Xsd2Code has a CustomTool which allows automatic generation when schema is modified.". The Xsd2Code seems to generate duplicate classes and properties that's already been created in partial class (which got generated by "Run Xsd2Code Generation".

Is this a bug or am I doing anything wrong.

Thanks.

Aug 5, 2011 at 1:00 AM

THanks Michael,

If we updated the namespace and imported both name spaces on main program, would not that cause the same issue (duplicate ...)?

 

THanks.

Aug 5, 2011 at 1:24 AM

Yes, that’s correct.

However if you are using both name spaces in the same assembly and some class names clashed you would obviously have to fully qualify the type with its appropriate namespace.

I know this is not a very elegant solution, however it provided me with a work-around until I could devise a better solution.

Regards

Michael

From: nkpun [email removed]
Sent: Friday, 5 August 2011 11:01 AM
To: Minto, Michael
Subject: Re: automatic generation on xsd modification [Xsd2Code:267825]

From: nkpun

THanks Michael,

If we updated the namespace and imported both name spaces on main program, would not that cause the same issue (duplicate ...)?

THanks.

Aug 5, 2011 at 2:06 AM

Thanks Michael, totaly agree with you. Will stick with fully qualified name space.