From 3a281b8f58665be676ddb8ed551547140470cc4d Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 4 Sep 2018 14:39:03 -0700 Subject: [PATCH] Allow TagHelpers to occur after unclosed C# blocks without assert failures. - This scenario wasn't considered previously. #2566 --- .../Legacy/TagHelperParseTreeRewriter.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs index fa557db9eb..8e3a7238c0 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs @@ -136,8 +136,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // scope. Block scopes are special cases in Razor such as @

would cause an error because there's no // matching end

tag in the template block scope and therefore doesn't make sense as a tag helper. BuildMalformedTagHelpers(_trackerStack.Count - activeTrackers, errorSink); - - Debug.Assert(activeTrackers == _trackerStack.Count); } BuildCurrentlyTrackedBlock();