Where does IAppBuilder.UseWebApi come from?
- Posted in:
- ASP.NET Web API
- OWIN
- Self Host
I was converting a self-hosted ASP.NET Web API application from Microsoft ASP.NET Web API Self Host to use OWIN Self Hosting. Everything went find until I tried to add the route configuration to the OWIN pipeline. Samples I found indicate all you have to do is call “UseWebApi” but the IAppBuilder.UseWebApi method did not resolve for me:
After some searching around I found that you will need to import the Microsoft ASP.NET Web API 2 OWIN Self-Host Nuget package.
I didn’t realize that there was a separate Nuget package if you wanted to combine OWIN and ASP.NET Web API. It was a simple solution and honestly now that I think about it, should have been one of the first things I checked. This post is for the next person that runs into this issue.