SHFB icon indicating copy to clipboard operation
SHFB copied to clipboard

Unsupported library System.Collections.Immutable

Open WojciechNagorski opened this issue 8 years ago • 16 comments

SHFB doesn't support library System.Collections.Immutable. https://www.nuget.org/packages/System.Collections.Immutable/

After add reference to project SHFB can not create documentation. I have error message:

BUILD FAILED: The 'br' start tag on line 507 position 385 does not match the end tag of 'p'. Line 507, position 391.	TestCaseProject	SHFB	0	

WojciechNagorski avatar Jan 26 '18 08:01 WojciechNagorski

I've created pull request with example of this exception: https://github.com/EWSoftware/SHFB/pull/570

WojciechNagorski avatar Jan 26 '18 08:01 WojciechNagorski

System.Collection.Immutable is used in Microsoft.EntityFrameworkCore. This means that can't create documentation if you use new Entyty Framework Core.

WojciechNagorski avatar Jan 26 '18 08:01 WojciechNagorski

This is a known issue with a number of the newer framework NuGet packages from Microsoft. See issue #560. They appear to have a bug in their XML comments file generators that can result in invalid files. A workaround for the time being is to manually fix the file in the package folder or, add a corrected copy to your SHFB project which should override the bad one.

As noted in the other work item, I can work around it by ignoring bad XML comments files but then you lose the comments from the base types. The only real fix is to report the issue to the package owner (Microsoft in this case) and have them fix the bad XML comments file.

EWSoftware avatar Jan 26 '18 15:01 EWSoftware

I understand that is issue in Microsoft's xml. It is part of html in xml file. Maybe you should fix xml before processing them. It isn't so hard. What do you think?

On Jan 26, 2018 16:58, "Eric Woodruff" [email protected] wrote:

This is a known issue with a number of the newer framework NuGet packages from Microsoft. See issue #560 https://github.com/EWSoftware/SHFB/issues/560. They appear to have a bug in their XML comments file generators that can result in invalid files. A workaround for the time being is to manually fix the file in the package folder or, add a corrected copy to your SHFB project which should override the bad one.

As noted in the other work item, I can work around it by ignoring bad XML comments files but then you lose the comments from the base types. The only real fix is to report the issue to the package owner (Microsoft in this case) and have them fix the bad XML comments file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EWSoftware/SHFB/issues/569#issuecomment-360824455, or mute the thread https://github.com/notifications/unsubscribe-auth/AQh-j4aJN2IOyL6M-4SBgNI2AgjwnycBks5tOfY8gaJpZM4Rt-kG .

WojciechNagorski avatar Jan 27 '18 12:01 WojciechNagorski

It's not my job to fix broken XML comments files. The build engine can't fix them on the fly either. As noted in the other thread, there should be reasonable expectation that XML comments files are well formed.

I'll add a workaround to just ignore such bad files but, like I said, if you want them truly fixed, you're going to have to complain to the package owner which is Microsoft in this case.

EWSoftware avatar Jan 27 '18 20:01 EWSoftware

I understand you but all you need to do is change <br> to <br/>. I just want to generate documentation to my code. I don't need reference to Microsoft code and documentation.

WojciechNagorski avatar Feb 05 '18 11:02 WojciechNagorski

It's January 2019. MS has not fixed the docs for System.Collections.Immutable. It has been more than a year.

As a pragmatic programmer, I cannot use your tool. FULL RESPECT. I fully support your position, I agree with you in full. I acknowledge my OCD. I like documentation, how am I going to explain my time fixing MS docs on my machine so I can generate documentation? How am I supposed to share this with my team?

Is this the hill you want to die on?; I am not willing to jump on the gerbil wheel and correct nuget package XML files from MS. Nor do I expect you to do the same. Give me the option. Give me the warning, do not give me broken documentation silently and explain why on the web so that I spend hours finding this page.

I have used a this tool for years; I got strange results after a hiatus. I spent hours chasing this down. My only ding; fail completely; do not give me broken documentation.

Your position is technically accurate and totally defensible; my response is I will not use SHFB again until you address meeting the user need. ASSUME: MS will continue to ship broken XML doc files in nuget. Blaming MS is like crying that it rains too much in Seattle. Your ask is reasonable, it is not being met; change your expectation.

You are the owner; you decide. I am saying goodbye to a favored tool.

I give feedback because this was a favored tool.

mprochaska avatar Jan 26 '19 11:01 mprochaska

@mprochaska This has been resolved for quite a while. Starting with version 2018.5.14.0, it ignores broken XML comments files and issues a BE0031 warning. The help file will build successfully but you'll be missing comments for base types from the broken comments files.

EWSoftware avatar Jan 26 '19 20:01 EWSoftware

Hello,

I installed from SHFBInstaller_v2018.12.10.0.zip last week.

I read the error messages in the log, saw undocumented methods that returned System.Collections.Immutable types and tracked down this article with a reason for won’t fix by searching System.Collections.Immutable SHFB

I am certain there is user error involved

I will set aside time to re-install and repo this on another machine if you are interested. Nothing told me how to self-help based on what I was seeing and a “won’t fix” statement on a similar issue on the web led me to choose another tool.

If I had this experience it is likely someone else will have the experience. I am not trying to make you wrong.

I think we disagree on the meaning on this turn of phrase: “The help file will build successfully but you'll be missing comments for base types from the broken comments files”

I would describe that as the output is mangled due to XML docs from MS nuget packages, you will get a warning, but no solution is provided for with SHFB.

You are welcome to disagree, but I want my methods documented, not stripped of documentation. I am happy there is a warning, many tools fail to even warn; but no documentation is a failure condition in my opinion. As an engineer, I fully understand your reasoning and your choice. But that leaves me with a broken scenario and no path forward with SHFB.

Respectfully,

~Michael

From: Eric Woodruff [email protected] Sent: January 26, 2019 13:29 To: EWSoftware/SHFB [email protected] Cc: mprochaska [email protected]; Mention [email protected] Subject: Re: [EWSoftware/SHFB] Unsupported library System.Collections.Immutable (#569)

@mprochaskahttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmprochaska&data=02%7C01%7C%7C6f10a47d43084a72aefe08d683cce3e2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636841313345060373&sdata=Ds8jGUAaRwYG5V4gH%2FSmQda%2BZMfJJ%2F1ZC7dYkBqAnSc%3D&reserved=0 This has been resolved for quite a while. Starting with version 2018.5.14.0, it ignores broken XML comments files and issues a BE0031 warninghttps://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fewsoftware.github.io%2FSHFB%2Fhtml%2F0d3d6929-8094-4133-be7e-4e66222c7b53.htm&data=02%7C01%7C%7C6f10a47d43084a72aefe08d683cce3e2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636841313345060373&sdata=GEoq%2BgEOr2Uto7wTeSn%2BSgN%2Fw%2FwgvWHG1964DJJ9LMc%3D&reserved=0. The help file will build successfully but you'll be missing comments for base types from the broken comments files.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEWSoftware%2FSHFB%2Fissues%2F569%23issuecomment-457863457&data=02%7C01%7C%7C6f10a47d43084a72aefe08d683cce3e2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636841313345060373&sdata=Rc0vL2nobiG%2BbM644ZBQ0qsDveu729j2Cc%2FMGylhRFo%3D&reserved=0, or mute the threadhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAANfCUvwAgUkio5Q9fUHWkyHGMJ8BqVfks5vHLqFgaJpZM4Rt-kG&data=02%7C01%7C%7C6f10a47d43084a72aefe08d683cce3e2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636841313345060373&sdata=p%2FLCE4immSFKvplFky8jy0Va63bgh9R25WXqBfS8B3A%3D&reserved=0.

mprochaska avatar Jan 28 '19 20:01 mprochaska

If this is the issue you ran into, you should have seen BE0031 warnings in the build log. If it's something else, I can look into it if you provide an example.

Regarding the missing docs from the topic list pages related to the BE0031 warning, it's not something that can be fixed without making the XML comments files valid. There's nothing more I can do with this issue. I have the build engine issue a warning so that you're aware of the problem but I nor SHFB can't magically insert valid documentation from a broken source. If you or anyone else can suggest a solution that actually inserts the missing info, feel free to suggest it.

If you want to stop using SHFB because of this, that's your choice but it seems like you're blaming the tool for a problem that it simply cannot fix and is beyond my control.

EWSoftware avatar Jan 29 '19 02:01 EWSoftware

Eric Woodruff,

Let’s step way back and cool off.

If you see any blame of you, your product or your choices in the following, I have misspoken. I made an engineering choice based on your product owner choice. I have abandoned your product, no blame, no judgement, just no path forward for me. I am trying to say “why” without blame. I am happy to give engineering hours and try again in the future.

I have been trying to be very clear. I fully understand your engineering choice. I fully accept it and agree with it AT THE TIME YOU MADE IT.

It has been a year, MS has made no progress on fixing their XML in nuget packages. (As a former MS employee, I have some insight into this, not authority – happy to share if asked). You are waiting for the mountain to come to you. If MS has not fixed their XML nuget packages in over a year, it is highly unlikely they will.

Your engineering point is well stated, well understood, and should I say, morally correct. I absolutely get it agree with and would support it today, if Microsoft showed any signs of movement. They are not moving, change hats.

Taking off the engineering hats: you are the product owner, I am a user. Your product does not adequately support libraries that use Microsoft Nuget packages from the perspective of an end user.

I do not want to stop using SHFB. I want you to give me the option, switch, whatever, so that SHFB will make a best guess based on broken MS nuget package documentation, let the buyer beware. (You do not seem to see the need for this; try and document an EF model library, emitting). I get it, this option would open a closed set (there are many ways to put this, I operate from set theory)

As it stands, you think your product is “fixed”, I think it breaks my documentation by cutting out my documentation because 3rd party sources are invalid.

MS is not just any 3rd party. I suggest change your product code to allow me to override, warn me, and let me suffer the consequences and accept Systems.Collections.Immutable, and the like.

I am not blaming the tool. I fully blame Microsoft for shipping non-confirming xml. Remember MIME?

I regret that SHFB has no path forward for me. I fully agree with your engineering decision. I would have made the same. I am asking you to reconsider your engineering decision as the product owner, nothing more. I have no hostility, I lay no blame, I have offered my time – I maintain software libraries too, I’ve been doing this for 20+ years.

Stop treating me like a pissed off youth with no consideration. I am long-toothed calm professional, I’ve moved on; I am offering to help, and giving you my reason for moving on. I fully respect you and your product. I abandoned a tool of choice for years, and you think I am mad or blaming the tool. I am trying to explain why. Whether or not you change your opinion is of no matter to me. It is your product, you own it. You decide.

Your product no longer works for me. (I am totally OK with that). I have found something else. My needs are met. I am concerned a favorite tool has a blind spot, you are free to disagree.

I would not have wasted my time contacting you if I did not see the rub and the conflict between the engineering hat and the product owner hat. I tried to show you the other side. No blame coming from this side.

To the point: I think you are killing the uptake and use of SHFB by insisting that all MS nuget packages provide valid XML. You have years of history showing you that MS will do what it does. You are the product owner, the choice is yours. I think you are falling on your sword.

Again. Full Respect, no judgement, but as a user, I moved on because of an engineering choice that you call success, that does not meet my needs, and you get a 10:10 on the reason why.

I not blaming the tool; I am worried it will die. I moved on because of your engineering choice.

I reached out because I cared. Do as you will. If you want some of my time, ask.

~Michael

I am willing to talk more, but let’s get out of “blame”, “fault”, and “judgement”. I have already made another choice. I gave you feedback for your consideration to improve your product. Feedback is always optional, take it or leave it.

“BE0031 warning, it's not something that can be fixed without making the XML comments files valid.” That is an engineering perspective. In your domain there are tools that handle the malformed XML from MS. You are in no way wrong, but being an hard-case is diminishing your product impact IMO.

Microsoft should not ship bad XML. They do, have, and will continue to do so. Cutting out the documentation is one answer. If you choose to stick by it so be it. You are the product owner – it is your choice.

I am not mad, angry, and frankly I no longer care. You keep pulling this to blame. I offer no blame, if anyone is to blame it is MS. Understand that stripping comments is like giving me a car with 3 wheels. It is still a car, you took the 4th wheel for good reason; but I am left with a car with 3 wheels. Would you drive a car missing the 4th wheel? Not as an engineer, as the user that asked for a car?

From: Eric Woodruff [email protected] Sent: January 28, 2019 19:49 To: EWSoftware/SHFB [email protected] Cc: mprochaska [email protected]; Mention [email protected] Subject: Re: [EWSoftware/SHFB] Unsupported library System.Collections.Immutable (#569)

If this is the issue you ran into, you should have seen BE0031 warnings in the build log. If it's something else, I can look into it if you provide an example.

Regarding the missing docs from the topic list pages related to the BE0031 warning, it's not something that can be fixed without making the XML comments files valid. There's nothing more I can do with this issue. I have the build engine issue a warning so that you're aware of the problem but I nor SHFB can't magically insert valid documentation from a broken source. If you or anyone else can suggest a solution that actually inserts the missing info, feel free to suggest it.

If you want to stop using SHFB because of this, that's your choice but it seems like you're blaming the tool for a problem that it simply cannot fix and is beyond my control.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEWSoftware%2FSHFB%2Fissues%2F569%23issuecomment-458387061&data=02%7C01%7C%7C1751b32fc322429fc4e008d685945da9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843269599522306&sdata=ZKOXEgtSAV9I5%2FinN%2BgY%2BAAHzBo%2B9ThjyyLoKRTjW0o%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAANfCT_XnQTH-3yLmer5g5BE-xEM3_YCks5vH7augaJpZM4Rt-kG&data=02%7C01%7C%7C1751b32fc322429fc4e008d685945da9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843269599532311&sdata=bqbWTbWBMOVXeJG%2BgVZ4ZWwwnDVUGYuWXL0fnSFdiwo%3D&reserved=0.

mprochaska avatar Jan 30 '19 03:01 mprochaska

I apologize if it seemed like I was taking my frustration out on you. It's not what I intended. There may be ways to handle malformed XML but none that I could find short of writing my own XML parser which wasn't something I felt I could do so I fixed the issue as best I could. This is an open source project and I do welcome contributions. If somebody does want to tackle it and solves it, I'm more than happy to merge that solution. I can't do anything more with it but I'm not opposed to using someone else's solution if there is one. The same is true for any other issues or new features.

Looking into this further, I did find this issue in the Roslyn project which referenced another issue in the corefx project which addresses this very issue. It does appear that Microsoft has fixed their IntelliSense tooling so that it doesn't generate the invalid XML anymore. That said, it won't affect previously released NuGet packages which makes sense since I don't think it's even possible to replace prior published versions.

I downloaded the 1.4.0 and 1.5.0 version of the System.Collections.Immutable NuGet package which started this issue. Comparing the XML comments files in the two, the 1.5.0 version has been fixed. So, if you are using or update to the latest release of the packages, the issue resolves itself. However, all is not perfect as I do see that in the 1.5.0 copy of the comments many of the cref attribute values are missing the type code prefix such a "T:" or "M:" or "P:". Without those, it will fail to resolve the reference when generating links to the online content. You'll still get base type documentation but links to the online topics from them will not be useable for those ill-formed link targets.

If you are using the latest release of the NuGet packages, I suspect the issue with the invalid cref values is what you actually ran into and it was complaining that it couldn't resolve those bad links. That can be fixed since it's easy enough to check for the missing type code prefix and try the common ones to see if it can find a match.

EWSoftware avatar Jan 31 '19 03:01 EWSoftware

Much respect Eric.

I am using System.Collections.Immutable 1.5.0.

Current guidance from static code analyzers is to avoid type code prefixes. I have no opinion on the topic, I am not informed enough to have one, but I can tell you Microsoft and SonarLint both flag such use at build time on my projects.

I will take a look at the open source projects that handle the those crefs and give you annotated sources. I will seriously consider creating a pull request if I feel I am competent to do so. I need to do a deep dive into your code first.

I have been using SHFB since at least 2008; it is my go to tool. I will assist as I can.

Non authoritative experience. On several of my projects at MS the compiler output XML was an input to a secondary system. It was antiquated when I started at MS in 2008; it exists for valid reasons. One of which is, it allows “content managers” to clean up and publish official documents based on engineering input. As an engineer on such projects, I was questioned on English language translations. English was only 1 of 20+ outputs of this secondary tool.

Regards,

~Michael

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Eric Woodruff [email protected] Sent: Wednesday, January 30, 2019 8:19:21 PM To: EWSoftware/SHFB Cc: mprochaska; Mention Subject: Re: [EWSoftware/SHFB] Unsupported library System.Collections.Immutable (#569)

I apologize if it seemed like I was taking my frustration out on you. It's not what I intended. There may be ways to handle malformed XML but none that I could find short of writing my own XML parser which wasn't something I felt I could do so I fixed the issue as best I could. This is an open source project and I do welcome contributions. If somebody does want to tackle it and solves it, I'm more than happy to merge that solution. I can't do anything more with it but I'm not opposed to using someone else's solution if there is one. The same is true for any other issues or new features.

Looking into this further, I did find this issue in the Roslyn projecthttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Froslyn%2Fissues%2F24177&data=02%7C01%7C%7C7c48a8334b854ef690fd08d6872ae4fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636845015625510477&sdata=8yJFRqqrEQUAkEokQe0TqzDcIcHFp7flAyNegZWEy9E%3D&reserved=0 which referenced another issue in the corefx projecthttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcorefx%2Fissues%2F26263&data=02%7C01%7C%7C7c48a8334b854ef690fd08d6872ae4fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636845015625520476&sdata=HTb3M5By9E6vsGC8J9x1t3g2hlHRG%2FYtkmdP%2Bw65vgU%3D&reserved=0 which addresses this very issue. It does appear that Microsoft has fixed their IntelliSense tooling so that it doesn't generate the invalid XML anymore. That said, it won't affect previously released NuGet packages which makes sense since I don't think it's even possible to replace prior published versions.

I downloaded the 1.4.0 and 1.5.0 version of the System.Collections.Immutable NuGet package which started this issue. Comparing the XML comments files in the two, the 1.5.0 version has been fixed. So, if you are using or update to the latest release of the packages, the issue resolves itself. However, all is not perfect as I do see that in the 1.5.0 copy of the comments many of the cref attribute values are missing the type code prefix such a "T:" or "M:" or "P:". Without those, it will fail to resolve the reference when generating links to the online content. You'll still get base type documentation but links to the online topics from them will not be useable for those ill-formed link targets.

If you are using the latest release of the NuGet packages, I suspect the issue with the invalid cref values is what you actually ran into and it was complaining that it couldn't resolve those bad links. That can be fixed since it's easy enough to check for the missing type code prefix and try the common ones to see if it can find a match.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEWSoftware%2FSHFB%2Fissues%2F569%23issuecomment-459199963&data=02%7C01%7C%7C7c48a8334b854ef690fd08d6872ae4fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636845015625530475&sdata=1fQwO5t7cyLy7FTqaziWOufqTfsNxRnCijXF8ts4pHE%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAANfCT3Wu5VcofUDZP1h-CrOK68yHO13ks5vImC5gaJpZM4Rt-kG&data=02%7C01%7C%7C7c48a8334b854ef690fd08d6872ae4fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636845015625540486&sdata=VGoZxAGBjwye%2Fh4GUTVT1OpI0Zz6nzpG3ZsQ8w0P5BA%3D&reserved=0.

mprochaska avatar Jan 31 '19 03:01 mprochaska

Yes, the prefixes aren't needed in the code comments but the compiler should still be fully qualifying and prefixing the attributes in the comments file it generates. That hasn't changed as far as I know. Since Microsoft is using an external tool, there are no guarantees I suppose. I know they've handled their comments separately for a long time even when they were in charge of the Sandcastle tools starting back in 2006.

EWSoftware avatar Feb 01 '19 03:02 EWSoftware

Eric, please open a private contact with me if you want me to take a deep dive. I am offering. I spent last week looking as CS101 topics to prepare for my interview today.

I am motivated. I am interested. Let's have a private conversation if you want me to dig in. I have time to give. I want to talk about your perspective, scope, and limits. I am a minimal change dev. I've pulled your source in prep, I have not started a deep dive. I in no way want to rewrite it. Minimal impact is a switch, or any other option of your choice. This is the wrong forum to discuss what you want. We have shared our dirty laundry, let us talk in private.

I specifically want your guidance, limits and goals. My goal is simple, some mechanism for handling Systems.Collections.Immutable 1.5.0. We accomplish that, and we can generalize. You are the product owner, you are in charge.

~M

mprochaska avatar Feb 05 '19 08:02 mprochaska

There's no e-mail address on your profile and GitHub doesn't appear to allow private messaging anymore. You can contact me via e-mail using the one on my profile or in the SHFB help file. A good starting point would be an example that reproduces the issue in question.

EWSoftware avatar Feb 07 '19 02:02 EWSoftware