dimanche 4 janvier 2015

A route named 'XXX' could not be found in the route collection


Vote count:

0




I'm trying to resolve a Web Api 2 route using UrlHelper when the error stated in the title occures.



response.Headers.AddLinkHeader(new FirstLink
{ Target = new Uri(
urlHelper.Link(routeName, // exception occures here
new { page = 1, pageSize })) });


My routes are registered using attribute routing, and when I access GlobalConfiguration.Configuration.Routes in the related method where the exception occures, I can clearly see that my route has been registered. Do routes need to be prefixed in order to resolve them? Or doesn't this work with attribute routing?



asked 1 min ago

xvdiff

453






A route named 'XXX' could not be found in the route collection

Aucun commentaire:

Enregistrer un commentaire