Reputation: 3110
I have build a Web API 2.2 project using Visual Studio 2015 Community Edition. Attribute RoutePrefix
is not found. After searching the internet, I found PM Console Command : Update-Package Microsoft.AspNet.WebApi.Core -reinstall
. It solved the problem but as soon as I right click on the Solution and Click Rebuild Solution
. Attribute RoutePrefix
again starts giving error of not found. Can anybody tell me what is wrong with Visual Studio.
Upvotes: 0
Views: 1106
Reputation: 4215
Add a RoutePrefix attribute to the controller. This attribute defines the initial URI segments for all methods on the controller.
[RoutePrefix("api/Employee")]
public class EmployeeController : ApiController
{
// ...
}
Upvotes: 0