0
ich eine ASP.NET-WebAPI Anwendung erstellt, und ich habe diesen Fehler habe:Der Typ oder Namespace-Namen HostAuthenticationFilter nicht gefunden
Der Typ oder Namespace-Namen HostAuthenticationFilter konnte nicht gefunden werden ...
Der Code wurde automatisch generiert, ich denke, es muss eine Referenz sein, konnte aber diese Referenz nicht finden.
using System.Web.Http;
using Microsoft.Owin.Security.OAuth;
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// Configure Web API to use only bearer token authentication.
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
Ja, ich habe es installiert ist. –
Es war das Paket Microsoft.AspNet.WebApi.Owin, genau wie du gesagt hast. Ich habe es deinstalliert und es erneut installiert. Alles hat funktioniert. –