Q:

How to use Microsoft xsd.exe with TrainingCenterDatabasev2 Schema?

I have TCX exercise files which are written using the schema at https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd.  I have been using them for years with Java and JAXB.  I am trying to write a C# application to do the same thing.  It is not going well.  I can generate C# classes using xsd.exe as provided by Visual Studio.  However, they do not make sense to me and cannot be used to deserialize my TCX files.
The basic structure of TCX files (at least the part in which I am interested) is they have a number of Activities containing a number of Laps containing a number of Tracks containing a number of Trackpoints.  The Trackpoints have latitude, longitude, and heart rate as the main items of interest.
The xsd-generated C# classes have an Activity_t[], an ActivityLap_t[], and a Trackpoint_t[][].  There is no Track_t[] and the string Track_t does not appear in the file even though it is in the .xsd, for example in this excerpt for the Lap and Track.
<xsd:complexType name="ActivityLap_t">
        <xsd:sequence>
            <xsd:element name="TotalTimeSeconds" type="xsd:double"/>
            <xsd:element name="DistanceMeters" type="xsd:double"/>
            <xsd:element name="MaximumSpeed" type="xsd:double" minOccurs="0"/>
            <xsd:element name="Calories" type="xsd:unsignedShort"/>
            <xsd:element name="AverageHeartRateBpm" type="HeartRateInBeatsPerMinute_t" minOccurs="0"/>
            <xsd:element name="MaximumHeartRateBpm" type="HeartRateInBeatsPerMinute_t" minOccurs="0"/>
            <xsd:element name="Intensity" type="Intensity_t"/>
            <xsd:element name="Cadence" type="CadenceValue_t" minOccurs="0"/>
            <xsd:element name="TriggerMethod" type="TriggerMethod_t"/>
            <xsd:element name="Track" type="Track_t" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="Notes" type="xsd:string" minOccurs="0"/>
            <xsd:element name="Extensions" type="Extensions_t" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>You can extend Training Center by adding your own elements from another schema here.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="StartTime" type="xsd:dateTime" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Track_t">
        <xsd:sequence>
            <xsd:element name="Trackpoint" type="Trackpoint_t" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

I don't understand how to deal with the [][] nor why it would be generated.  And as mentioned it fails to parse.

error CS0030: Cannot convert type
  'TrainingCenterDatabaseV2.Trackpoint_t[] to
  TrainingCenterDatabaseV2.Trackpoint_t.

(The namespace I used is TrainingCenterDatabaseV2.)
This is the code used to deserialize:
private const string NS_TrainingCenterDatabase_v2 = "http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2";

XmlSerializer xmlSerializer = new XmlSerializer(typeof(TrainingCenterDatabase_t),
                NS_TrainingCenterDatabase_v2);
FileStream fs = new FileStream(fileName, FileMode.Open);
XmlReader reader = XmlReader.Create(fs);
TrainingCenterDatabase_t tcx = (TrainingCenterDatabase_t)xmlSerializer.Deserialize(reader);

Not knowing where to go with this I tried the Visual Studio plugin, xsd2code++.  This generates sensible C# classes with  List<Activity_t>, List<ActivityLap_t>, and List<Trackpoint_t>.  It also does not have Track_t, which seems to be somewhat superfluous.
However, it also fails to parse.  I believe the problems here have to do with the lack of annotations it generates, compared to the ones generated from xsd.exe.  I believe the problem is that it cannot handle the namespaces without those annotations, but I have seen no way to set options to get around that.  As stated, I am not experienced with deserialization in C#.  For my current purposes I have implemented reading the TCX files using XDocument rather than deserialization.  However, I am curious as to why what I tried did not work, especially since xsd.exe has been around for a long time.
Thanks in advance.

A:

This appears to be a bug with the xsd.exe tool itself. I would recommend using LinqToXsd (requires .NET Core 2.1), which is another Microsoft-developed technology for accessing XML data using an XSD; it's also more advanced than xsd.exe and in my quick testing appears to fully handle the above Garmin training center database schema without issue. 
Also if you cannot install .NET Core on your machine, you can use this nuget package instead. The .NET Core version requires .NET Core 2.1 to actually generate code, but that generated code that can be used in an app that targets .NET Framework 4.6.2 and above.

