Есть проект изначально чистый ASP.NET MVC, хочу внедрить в него функциональность Web API. Добавил следующие файлы в проект:
App_Start\WebApiConfig.cs
Providers\ApplicationOAuthProvider.cs
Controllers\ValuesController.cs
При запуске проекта возникают 3 ошибки:
CS1061 'HttpConfiguration' does not contain a definition for 'SuppressDefaultHostAuthentication' and no extension method 'SuppressDefaultHostAuthentication' accepting a first argument of type 'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?) App_Start\WebApiConfig.cs
CS0246 The type or namespace name 'HostAuthenticationFilter' could not be found (are you missing a using directive or an assembly reference?) App_Start\WebApiConfig.cs
CS1061 'HttpConfiguration' does not contain a definition for 'MapHttpAttributeRoutes' and no extension method 'MapHttpAttributeRoutes' accepting a first argument of type 'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?) App_Start\WebApiConfig.cs
Содержание App_Start\WebApiConfig.cs:
public static void Register(HttpConfiguration config)
{
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
Гугление ни к чему хорошему меня не привело(