In RC1, IUrlHelper could be injected in services (with services.AddMvc() in startup class)
IUrlHelper
services.AddMvc()
This doesn\'t work anymore in <
For Net Core 2.0
Add this after service.AddMvc()
service.AddMvc()
services.AddSingleton(); services.AddScoped(factory => { var actionContext = factory.GetService() .ActionContext; return new UrlHelper(actionContext); });