Risk
Risk

Reputation: 113

.Net Core tag helper intellisense not working

I am having issues with .NET core and tag helpers. the IntelliSense is not displaying or being registered when I type in asp-for. IntelliSense, it doesn't fix the issue.

ViewImport.cshtml

itis at my view

I've also made the reference/injection in the _ViewImports file for the mvc tag helpers.

@addTagHelper *, Microsoft.AspNetCore.MVC.TagHelpers
     <div class="form-group row">
                <label asp-for="Email" class="col-sm-2 col-form-label">Email</label>
                <div class="col-sm-10">
                    <input asp-for="Email" class="form-control" placeholder="Email" />
                    <span asp-validation-for="Email" class="text-danger"></span>
                </div>

Upvotes: 1

Views: 1163

Answers (1)

Safyan Yaqoob
Safyan Yaqoob

Reputation: 552

Two steps to solve the problem.

1.Install Razor tool from package manager console. It is pre-release for now

Install-Package Microsoft.AspNetCore.Razor.Tools –Pre

2.Download and install Razor Language Services from marketplace. (Your visual studio instance should be closed)

After restart visual studio, intellisense and coloring should be working for tag helpers.

Upvotes: 2

Related Questions