FransBouma / DocNet

Your friendly static documentation generator, using markdown files to build the content.
http://fransbouma.github.io/DocNet/
248 stars 36 forks source link

Nesting groups without index pages could lead to 'Collection was modified' exception. #37

Closed FransBouma closed 8 years ago

FransBouma commented 8 years ago

A set of nested groups will lead to an exception:

Exception: System.InvalidOperationException
Description: Collection was modified; enumeration operation may not execute.
Stack-trace:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at Docnet.NavigationLevel.GenerateOutput(Config activeConfig, NavigatedPath activePath) in C:\Myprojects\VS.NET Proje
cts\Github\FransBouma\DocNet\src\DocNet\NavigationLevel.cs:line 93
   at Docnet.NavigationLevel.GenerateOutput(Config activeConfig, NavigatedPath activePath) in C:\Myprojects\VS.NET Proje
cts\Github\FransBouma\DocNet\src\DocNet\NavigationLevel.cs:line 95
   at Docnet.NavigationLevel.GenerateOutput(Config activeConfig, NavigatedPath activePath) in C:\Myprojects\VS.NET Proje
cts\Github\FransBouma\DocNet\src\DocNet\NavigationLevel.cs:line 95
   at Docnet.Engine.GeneratePages() in C:\Myprojects\VS.NET Projects\Github\FransBouma\DocNet\src\DocNet\Engine.cs:line
98
   at Docnet.Engine.DoWork() in C:\Myprojects\VS.NET Projects\Github\FransBouma\DocNet\src\DocNet\Engine.cs:line 47
   at Docnet.Program.Main(String[] args) in C:\Myprojects\VS.NET Projects\Github\FransBouma\DocNet\src\DocNet\Program.cs
:line 53
Inner exception:
<null>

because the engine will create an index page for the group, but by doing that is changing the set of elements of the group (to add the index). This doesn't always succeed, as sometimes it can lead to the exception above.