Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c# region support for code snippets broken by #endregion with extra text #1200

tobiasbunyan opened this issue Jan 18, 2017 · 1 comment
bug A bug to fix


Copy link


The regex for detecting #endregion in c# code snippet support expects to only have whitespace to the end of the line after #endregion. If there is extra text the #endregion is not detected, resulting in an error.

Functional impact

Documentation build fails.

Minimal repro steps

  1. Create a class with text after the endregion:
#region TestRegion
public class someclass
#endregion TestRegion
  1. Reference this file in a conceptual document using a code snippet markdown:
  1. Build the documentation

Expected result

The code snippet is generated as normal.

Actual result

Error occurs and build fails.

Document.CompilePhaseHandler.ConceptualDocumentProcessor.Build.BuildConceptualDocument](articles/ name TestRegion is not found Web.Documentation C:\Users\tbunyan\Source\Workspaces\Web.Documentation\EXEC

Further technical details

Whilst adding text after an #endregion has no effect, it is not actually prohibited, and so should be allowed for.

Changing the CSharpCodeSnippetCommentEndLineRegex value in Microsoft.DocAsCode.Dfm.TagNameBlockPathQueryOption should alleviate this.

Untested suggestion:



Copy link

vwxyzh commented Feb 20, 2017

@tobiasbunyan This bug should be fixed in current release version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug A bug to fix
None yet

No branches or pull requests

3 participants