I am having trouble getting Tag Helpers enabled in my project.
Here is a summary of the project setup:
Microsoft.AspNet.Mvc": "6.0.0-beta4
@addTagHelper"*,Microsoft.AspNet.Mvc.TagHelpers"
No build errors or warnings.
Must missing something, but I don't know what.
UPDATE:
Seems I am part of the way there. I added @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
to the _ViewStart.chtml.
Razor is now processing things like <a asp-controller="Home" asp-action="Summary" title="Manage">TEST</a>
as a link with a proper href attribute. However intellisense on not working.
1) In your project.json
dependencies
, make sure you have these 3:
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
2) In your project.json
tools
, make sure you have:
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final"
3) In Your Views\_ViewImports.cshtml
, make sure you have:
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Then rebuild
the project and you should be good to go. (If not try restarting VS.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With