Global Global - 3 years ago 257
ASP.NET (C#) Question

How can I set @addTagHandler globally in mvc core?

if i like to use my own TagHelper, i must add

@addTagHelper *, MyAssemly

in each cshtml-file.

Is it possible to set this global or only one time?

Answer Source

Add a _ViewImports.cshtml to your Views folder, and define your tag helpers there to have them globally on every View.

More info :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download