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

netstandard.xml is malformed #666

Closed
JBildstein opened this issue Mar 6, 2018 · 2 comments
Closed

netstandard.xml is malformed #666

JBildstein opened this issue Mar 6, 2018 · 2 comments

Comments

@JBildstein
Copy link

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.

@svick
Copy link

svick commented Mar 6, 2018

This sounds like it has the same underlying issue as https://github.com/dotnet/corefx/issues/26263. And when I look at a version of NETStandard.Library from the .Net Core MyGet feed, it seems to be okay.

So I think this has already been fixed and that the next time NETStandard.Library will be published, it will have correct netstandard.xml.

@JBildstein
Copy link
Author

Indeed, seems to be the same problem and it really is fixed in the 2.1 preview. I replaced the xml and ran the same code succesfully.
Thank you @svick

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants