L C L C - 3 months ago 62
ASP.NET (C#) Question

web api Route attribute not found

I need to implement a Method in my web service, which is available by a defined route.
So I used the

attribute like this:

[Route ("api/New")]
public void CreateNew(int id)
//Do stuff

But VS2013 says that the namespace "Route" can't be found.

I guess this can be solved by installing a nuget package.

Can anybody help?


Attribute Routing is native in ASP.NET MVC 5, or later, and ASP.NET Web API 2. check your MVC version it should be above the 4.