Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IApplicationBuilder does not contain a definition for UseWebApi

The VS 2015 Update 3 is out and I have started playing with it. But I hit a problem soon after. The IApplicationBuilder interface does not appear to have a definition for the UseWebApi extension method, but IAppBuilder does. In effect, I want to register my Web Api with the OWIN pipeline. Am I missing something?

like image 522
riccardo Avatar asked Jul 02 '16 19:07

riccardo


2 Answers

NuGet command:

Install-Package Microsoft.AspNet.WebApi.OwinSelfHost

Source

like image 124
Josh Avatar answered Nov 15 '22 06:11

Josh


There is no need for the IApplicationBuilder interface to have a definition for the UseWebApi extension method. In IAppBuilder, it was used to register a Web Api with OWIN. But for IApplicationBuilder, because ASP.NET Core uses a unified model for both Web Api and MVC services, simply use the IApplicationBuilder.UseMvc method. It works!

like image 44
riccardo Avatar answered Nov 15 '22 05:11

riccardo