Skip to content

Exception when typing ampersand inside attribute in VS2026 #274

Description

@dodexahedron

If the cursor is inside an attribute's quotes and you type an ampersand and any other character following it (to put in an XML-escaped entity), the below exception occurs.

Ignoring it and continuing to type keeps throwing it on every keystroke until the value is complete and terminated with a semicolon.

This is occurring in VS2026, and I have not tested it in 2022.

Happens in any attribute I've tried it in.

Exception message box text:

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------

   at MonoDevelop.MSBuild.Language.Expressions.ExpressionParser.ConsumeXmlName(String buffer, Int32& offset, Int32 endOffset) in D:\a\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuild\Language\Expressions\ExpressionParser.cs:line 407

   at MonoDevelop.MSBuild.Language.Expressions.ExpressionParser.ConsumeEntity(String buffer, Int32& offset, Int32 endOffset) in D:\a\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuild\Language\Expressions\ExpressionParser.cs:line 391

   at MonoDevelop.MSBuild.Language.Expressions.ExpressionParser.Parse(String buffer, Int32& offset, Int32 endOffset, ExpressionOptions options, Int32 baseOffset, Boolean& hasError, Char topLevelTerminator) in D:\a\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuildEditor\MonoDevelop.MSBuild\Language\Expressions\ExpressionParser.cs:line 67

   at MonoDevelop.MSBuild.Language.Expressions.ExpressionParser.Parse(String buffer, Int32 startOffset, Int32 endOffset, ExpressionOptions options, Int32 baseOffset, Bo......

<truncated>

Doesn't matter which element or which attribute. Seems to happen on all of them.

It does not happen when typing inside the text value of the element - only inside attributes.

Currently using version 2.9.524.37316 in Visual Studio 2026 Professional build 11206.111

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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