OWIN 启动:找不到入口点

OWIN Startup: Entry point was not found

以下 EntryPointNotFoundException 在执行 UseWebApi() 时被抛入我的 OWIN Startup 配置:

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 通过添加绑定重定向(双击警告)修复冲突后,一切正常。

我不明白这与我的问题有什么关系。