Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

netstandard.xml is malformed #666

@ABildstein

Description

@ABildstein

I'm trying to do some analysis of xml comments in C# code with roslyn and this works all fine until I try to get a comment from a framework type.

After some searching I found that the netstandard.xml file is malformed and trying to parse it with XElement.Parse throws an exception.
For example, the first occurrence is at line 652:

<returns><p sourcefile="netstandard.yml" sourcestartlinenumber="1" sourceendlinenumber="2"><p sourcefile="netstandard.yml" sourcestartlinenumber="1" sourceendlinenumber="1">A signed integer that indicates the relative values of <code data-dev-comment-type="paramref">a</code> and <code data-dev-comment-type="paramref">b</code>, as shown in the following table.  </p>
 <table><thead><tr><th> Value  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="4" sourceendlinenumber="4"> </th><th> Meaning  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="6" sourceendlinenumber="6"> </th></tr></thead><tbody><tr><td> Less than zero  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="8" sourceendlinenumber="8"> </td><td><code data-dev-comment-type="paramref">a</code> is less than <code data-dev-comment-type="paramref">b</code>, with casing ignored.  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="10" sourceendlinenumber="10"> </td></tr><tr><td> Zero  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="12" sourceendlinenumber="12"> </td><td><code data-dev-comment-type="paramref">a</code> equals <code data-dev-comment-type="paramref">b</code>, with casing ignored.  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="14" sourceendlinenumber="14"> </td></tr><tr><td> Greater than zero  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="16" sourceendlinenumber="16"> </td><td><code data-dev-comment-type="paramref">a</code> is greater than <code data-dev-comment-type="paramref">b</code>, with casing ignored.  <p>
<p sourcefile="netstandard.yml" sourcestartlinenumber="18" sourceendlinenumber="18"> </td></tr></tbody></table></p>
</returns>

and it looks like all of the errors are related to elements containing "netstandard.yml"

Also, for some reason the root node is "span" and not "doc" as usual. i.e.

<?xml version="1.0" encoding="utf-8"?><span>
<doc>
...
</doc></span>

Once I fixed those errors by removing them in my local copy, I am able to retrieve the xml comments with roslyn.

I checked NETStandard.Library version 2.0.0 and 2.0.1 from nuget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions