While migrating from ASP.NET Core RC1 to RC2 my TagHelpers do not resolve the injected IUrlHelpers.
[HtmlTargetElement("usermenulink", Attributes = "controller-name, action-name, menu-text, menu-item, active-item")]
public class UserMenuItemTagHelper : TagHelper
{
public IUrlHelper _UrlHelper { get; set; }
public UserMenuItemTagHelper(IUrlHelper urlHelper)
{
_UrlHelper = urlHelper;
}
//... abbreviated
}
Instead I get an exception:
An unhandled exception occurred while processing the request.
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Mvc.IUrlHelper' while attempting to activate '...TagHelpers.UserMenuItemTagHelper'.
Any ideas?