L C L C - 1 year ago 138
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download