c# – OWIN启动:找不到入口点

执行UseWebApi()时,我的OWIN启动配置中抛出以下EntryPointNotFoundException:

An exception of type ‘System.EntryPointNotFoundException’ occurred in
System.Web.Http.Owin.dll but was not handled in user code

Additional information: Entry point was not found.

Web API配置:

public class WebApiConfig
{
    internal static void Register(HttpConfiguration config)
    {
        // IOC container
        var container = new UnityContainer();
        config.DependencyResolver = new UnityResolver(container);

        // IOC resolution
        Resolver resolver = new Resolver();
        resolver.RegisterTypes(container);

        // Ignore any authentication which happens before the Web API pipeline.
        config.SuppressDefaultHostAuthentication();

        // API attribute routing
        config.MapHttpAttributeRoutes();

        // API formatters
        config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        config.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new StringEnumConverter());
    }
}

有人可以帮忙吗?

最佳答案 修复当然很奇怪.

我注意到Visual Studio在System.Net.Http.Formatting程序集的不同版本之间发现了冲突.

允许VS通过添加绑定重定向(双击警告)修复冲突后,每个工作正常.

我不明白这怎么可能与我的问题有关.

点赞