Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
157 stars 26 forks source link

Excpetion with error code -532462766 #2

Closed VoidVolker closed 5 years ago

VoidVolker commented 5 years ago

When I was building mye project with this package I have next error messsage:

> 1>  Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
> 1>     at DefaultDocumentation.Model.MethodItem.CleanParameters(String[] generics, GenericItem[] parentGenerics, String[] parameters)
> 1>     at DefaultDocumentation.Model.MethodItem.CleanParameters(String[] generics, GenericItem[] parentGenerics, String[] parameters)
> 1>     at DefaultDocumentation.Model.MethodItem.GetMethodName(XElement item, AMemberItem parent)
> 1>     at DefaultDocumentation.Model.MethodItem..ctor(AMemberItem parent, XElement item)
> 1>     at DefaultDocumentation.Converter.Parse(XDocument document)
> 1>     at DefaultDocumentation.Converter..ctor(XDocument document, String outputPath)
> 1>     at DefaultDocumentation.Converter.Convert(XDocument document, String outputPath)
> 1>     at DefaultDocumentation.Program.Main(String[] args)
> 1>....\packages\DefaultDocumentation.0.4.0\build\DefaultDocumentation.targets(7,5): error MSB3073: exit from command "dotnet "....\packages\DefaultDocumentation.0.4.0\build\..\tools\DefaultDocumentation.dll" /xml:"bin\Release\LTDriver.xml" /markdown:""" with code -532462766.
Doraku commented 5 years ago

Hum I had somewhat this kind of errors when all generic parameters do not have their documentation I believe.

Maybe you are missing some

<typeparam name="T">...</typeparam>

in your xlm comments on generic types/methods?

I know the error message is horribly inexistant and this is something I should work on ^^"

VoidVolker commented 5 years ago

Not sure, but maybe.

Doraku commented 5 years ago

I tried to give a better exception message with where you should be missing the generic parameter documentation. Can you update and see if it help you fix the problem?

v0.4.1

Doraku commented 5 years ago

Feel free to reopen this issue or create a new one if you still have a problem to find what is missing.

DSBloom commented 5 years ago

So if your project has any missing XML comments then DefaultDocumentation throws an exception and doesn't produce an .md file?

Not criticizing just trying to understand how it works. Because I am getting the same error.

Edit Ok yes thats how it works. I went and added triple slash comments to everything and it worked.

Doraku commented 5 years ago

If you put it that way it sure sounds bad :p Full disclosure: this project was entirely done on a business trip while I was bored on the plane and at the hotel, because the different equivalents I tried did not satisfied me.

This particular problem occurs when trying to get a clean name for a method with generic parameter(s). If the documentation for them are missing, it would be stuck with the ugly ``0 name. Personally I prefer to receive an error in this case instead of generating an incomplete documentation silently (and hopefully see the error someday while reviewing it) but this is just my take on my use case, I open to other suggestion :). Note that if the method itself has no comment documentation, it shouldn't crash.

If that was not your case, then there's probably something else I missed and I would definitely appreciate your setup/stacktrace!