Statiq.Web
Statiq.Web copied to clipboard
Ship default tag helper package with Wyam.Razor
The default tag helper package "Microsoft.AspNetCore.Mvc.TagHelpers" is needed for Razor to enable tag helper support. Without it, the Razor compiler will attempt to locate the tag helper assembly and will be unable to, leading to errors. Consider shipping it with the Razor module. Version 1.1.7 appears to be compatible with the current version of Razor used in Wyam (but will need a little testing).
In the meantime, adding the following to a config.wyam
file appears to work:
#n Microsoft.AspNetCore.Mvc.TagHelpers -v [1.1.7]
For anyone wanting to use TagHelpers on their wyam site, I had to:
Add this to config.wyam
:
#n Microsoft.AspNetCore.Mvc.TagHelpers -v [2.1.1]
Create a _ViewImports.cshtml
file, containing:
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Then, I had to delete the config.wyam.packages.xml file, and the dll, to force re-creating it (I believe this was required, not 100% sure).
Nice! Thanks for the follow-up. Reminds me I probably need to revisit this for Statiq too and hopefully ship it in the box.