Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Can';t让标记助手在.NETCore2.1中工作_C#_Asp.net Core_Asp.net Core Tag Helpers - Fatal编程技术网

C# Can';t让标记助手在.NETCore2.1中工作

C# Can';t让标记助手在.NETCore2.1中工作,c#,asp.net-core,asp.net-core-tag-helpers,C#,Asp.net Core,Asp.net Core Tag Helpers,我一直在尝试让标记助手工作,但不管我做什么,它们在intellisense中都无法识别,生成html的代码中没有断点,元素也不会转换 这是我的EmailTagHelper.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.TagHelpers; namespace eHealthy

我一直在尝试让标记助手工作,但不管我做什么,它们在intellisense中都无法识别,生成html的代码中没有断点,元素也不会转换

这是我的EmailTagHelper.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.TagHelpers;

namespace eHealthy.TagHelpers
{
    public class EmailTagHelper : TagHelper
    {
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = "a";    // Replaces <email> with <a> tag
        }
    }
}
这是我尝试调用帮助程序的页面

@model EditViewModel

@{
    ViewBag.Title = "title";
    Layout = "_Layout";
}

@*<h2>title</h2>*@

<form method="post">
    <email>
        potato
    </email>
</form>


<input type="hidden"/>
@model EditViewModel
@{
ViewBag.Title=“Title”;
布局=“_布局”;
}
@*头衔*@
马铃薯

取消您添加的标记帮助程序。删除eHealthy.TagHelpers助手,您甚至不需要创建它

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

默认情况下,新标记帮助程序会出现在该命名空间中吗?哦,对不起,不会,它们不会自动添加。您必须重新添加第二个taghelper,但不要在@addTagHelper行中使用引号。
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers