Skip to content

Commit b498551

Browse files
author
N. Taylor Mullen
committed
Make ~/ resolution show up at design time.
- This change results in proper errors for tags that utilize `~/`inside of local functions at design time. - Updated TagHelper in code blocks analyzer error to mention `~/` since it will typically be a cause of confusion. #10734
1 parent 8a7508d commit b498551

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static class DiagnosticDescriptors
5959
new DiagnosticDescriptor(
6060
"MVC1006",
6161
"Methods containing TagHelpers must be async and return Task.",
62-
"The method contains a TagHelper and therefore must be async and return a Task.",
62+
"The method contains a TagHelper and therefore must be async and return a Task. For instance, usage of ~/ typically results in a TagHelper and requires an async Task returning parent method.",
6363
"Usage",
6464
DiagnosticSeverity.Error,
6565
isEnabledByDefault: true);

src/Mvc/Mvc.Razor/ref/Microsoft.AspNetCore.Mvc.Razor.netcoreapp3.0.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ public void PopulateFeature(System.Collections.Generic.IEnumerable<Microsoft.Asp
356356
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("track", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
357357
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[poster^='~/']")]
358358
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[src^='~/']")]
359-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
360359
public partial class UrlResolutionTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
361360
{
362361
public UrlResolutionTagHelper(Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory urlHelperFactory, System.Text.Encodings.Web.HtmlEncoder htmlEncoder) { }

src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers
5050
[HtmlTargetElement("track", Attributes = "[src^='~/']", TagStructure = TagStructure.WithoutEndTag)]
5151
[HtmlTargetElement("video", Attributes = "[src^='~/']")]
5252
[HtmlTargetElement("video", Attributes = "[poster^='~/']")]
53-
[EditorBrowsable(EditorBrowsableState.Never)]
5453
public class UrlResolutionTagHelper : TagHelper
5554
{
5655
// Valid whitespace characters defined by the HTML5 spec.

0 commit comments

Comments
 (0)