Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I'm trying to create a super simple tag helper and render it into my view template as follow:
I also added in _ViewImports.cshtml already
But It cannot be rendered in my view
I tried the same thing in a new project created with Razor Pages template and it works
Could you please let me know why?
Thanks!!!!
Hi Marcus,
What version of Umbraco are you using?
Hi Huw,
I have just upgraded to 13.3.0
try just using @addTagHelper *, MyProject that works for me
@addTagHelper *, MyProject
If you use the project/assembly name in the _ViewImports.cshtml? I see that the namespace of your tag helper is MyProject.TagHelpers, but is that also the assembly name?
MyProject is the example namespace I replaced to capture screenshot. How to know that is assembly? Thank you
By default it will be the name of your project
I found that
In case the project/namespace contains "_" character so the assembly name will be replaced by "-".
In my case my_project namespace should be my-project in _ViewImports.cshtml.
For example:
@addTagHelper *, my-project
Thank you all !!!
I think you may be misunderstang the problem exactly even though you have solved it.
If I create a VS project called My_Project then the assembly name created when built is still My_Project, it does not replace the _ with a -
My_Project
_ with a -
Okay noted,
I published the project and checked .dll file in publish folder to know exactly assembly name.
Thanks again
that is good, but nothing in the build or publish process changes the _ to a -
_ to a -
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco - Cannot render basic tag helper
Hi all,
I'm trying to create a super simple tag helper and render it into my view template as follow:
I also added in _ViewImports.cshtml already
But It cannot be rendered in my view
I tried the same thing in a new project created with Razor Pages template and it works
Could you please let me know why?
Thanks!!!!
Hi Marcus,
What version of Umbraco are you using?
Hi Huw,
I have just upgraded to 13.3.0
try just using
@addTagHelper *, MyProject
that works for meIf you use the project/assembly name in the _ViewImports.cshtml? I see that the namespace of your tag helper is MyProject.TagHelpers, but is that also the assembly name?
MyProject is the example namespace I replaced to capture screenshot. How to know that is assembly? Thank you
By default it will be the name of your project
I found that
In case the project/namespace contains "_" character so the assembly name will be replaced by "-".
In my case my_project namespace should be my-project in _ViewImports.cshtml.
For example:
@addTagHelper *, my-project
Thank you all !!!
I think you may be misunderstang the problem exactly even though you have solved it.
If I create a VS project called
My_Project
then the assembly name created when built is still My_Project, it does not replace the_ with a -
Okay noted,
I published the project and checked .dll file in publish folder to know exactly assembly name.
Thanks again
that is good, but nothing in the build or publish process changes the
_ to a -
is working on a reply...