You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.
Just to confirm, is it still necessary to put @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers at the top of the _Layout.cshtml file? I tried putting it at the top of _ViewImports.cshtml and it doesn't work. It only works in the _Layout.cshtml file.
Also, are quotes still required? The doc shows both, but I thought I read somewhere it's not the default (so I can only assume it's not defaulted for a reason).
As long as your _Layout.cshtml is a sibling or a grand child of your _ViewImports.cshtml file you should not need to add an @addTagHelper statement to it.
And what about the second question - are quotes optional? (i.e. @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"). I noticed by default there are no quotes when a new project is created. What is preferred?
Yes, quotes are optional. There's currently a bug open about not having quotes and not being able to hit enter at the end of the directive line. Therefore, until that's fixed I'd say write your directives with quotes; after that, whatever your own preference is 😄
As for the other issue, it appears the view imports was being loaded from an assembly (via the embedded file provider) and not the main project, causing the issue. It's working now, I appreciate all your help, thanks. ;)
Just to confirm, is it still necessary to put
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
at the top of the_Layout.cshtml
file? I tried putting it at the top of_ViewImports.cshtml
and it doesn't work. It only works in the_Layout.cshtml
file.Also, are quotes still required? The doc shows both, but I thought I read somewhere it's not the default (so I can only assume it's not defaulted for a reason).
I was following this but it doesn't help: dotnet/aspnetcore#534
The text was updated successfully, but these errors were encountered: