"ExcludeIncludedTypes" Setting??

Dec 7, 2012 at 5:29 PM

Either I don't understand what the "ExcludeIncludedTypes" setting is supposed to do or it doesn't work right...

I have the following schema definition - notice the included schema and its use (bold text below):

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://foo.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation=".\CloudWallMaterialParameters.xsd" />
    <xs:complexType name="MaterialParametersType">
            <xs:element name="CloudWallMaterialParameters" xmlns:q2="http://foo.com/" type="q2:CloudWallMaterialParametersType" />
    <xs:element name="MaterialConfiguration">
                <xs:element name="ProductId" type="xs:string" />
                <xs:element name="MaterialParameters" xmlns:q1="http://foo.com/" type="q1:MaterialParametersType" />

When I set "ExcludeIncludedTypes" in Xsd2Code, I am expecting that the generated code for this schema should not include a definition for CloudWallMaterialParametersType since that complex type is defined in the included CloudWallParameters.xsd, but it does. This causes problems with other schemas in the same project that also include the CloudWallParameters.xsd schema and reference it.

Any suggestions would be appreciated.

Dec 9, 2012 at 3:35 PM


Thank you to have reported this bug.

You can download the fix here : http://xsd2code.codeplex.com/releases/view/98851

Tell me please if it work fine for you.


Dec 17, 2012 at 4:30 PM
Edited Dec 17, 2012 at 5:16 PM

The new build doesn't appear to have fixed the bug I reported.

[edit] After a bit of investigation, it appears that the download link isn't pointed to the 3.6 beta build - the installed files still have a date of 2010 on them and a version of 3.5

I grabbed the latest code from the repository, built and installed, and the version is now shown as 3.6

The code generation behavior with ExcludeIncludedTypes is better, but...

In my case, I have a nested hierarchy of includes - a.xsd includes b.xsd which includes c.xsd

In the generated code from the latest build, the code generated from a.xsd no longer includes a class definition for the types in b.xsd, but DOES still include the class definition for the types in c.xsd - so there's still a bit of a bug.



Dec 17, 2012 at 8:24 PM

I understand the problem better. I'll have to incorporate a recursive processing to eliminate all types.

I think I'll be able to finish now.

Thank you to have reported this issue.


Dec 24, 2012 at 10:17 AM


fix is done in this new alpha release : http://xsd2code.codeplex.com/releases/view/98851

It works fine for me with 3 levels of included schema.

Thank you, if you can test it in your context.

Merry Christmas all !


Jan 2, 2013 at 8:30 PM

Hi Pascal - I downloaded the latest alpha and it seems to work very well now. Thanks for all your effort on this bug! It has made it possible for me to use Xsd2Code in my project.

Jan 18, 2013 at 12:34 PM

I install the version 3.6 because i need this to work with XSD files, but in some files, it crashes my Visual Studio 2010.

Can anyone help me?



Feb 7, 2013 at 1:04 PM
Running Xsd2Code with ExcludeIncludedTypes=true crashes my Visual Studio 2012 too. It also crashes when running from command line.