Skip to content

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

@FransBouma

Description

@FransBouma

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions