简体   繁体   English

OWIN启动:未找到入口点

[英]OWIN Startup: Entry point was not found

The following EntryPointNotFoundException is being thrown in my OWIN Startup configuration upon executing UseWebApi() : 执行UseWebApi()时,我的OWIN Startup配置中抛出以下EntryPointNotFoundException

EntryPointNotFoundException

An exception of type 'System.EntryPointNotFoundException' occurred in System.Web.Http.Owin.dll but was not handled in user code System.Web.Http.Owin.dll中出现“System.EntryPointNotFoundException”类型的异常,但未在用户代码中处理

Additional information: Entry point was not found. 附加信息:未找到入口点。

Web API configuration: 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());
    }
}

Can anyone help? 有人可以帮忙吗?

The fix was certainly quite odd. 修复当然很奇怪。

I noticed that Visual Studio found conflicts between different versions of the System.Net.Http.Formatting assembly. 我注意到Visual Studio在System.Net.Http.Formatting程序集的不同版本之间发现了冲突。

After allowing VS to fix the conflicts by adding the binding redirect (double clicking on the warning), every worked fine. 允许VS通过添加绑定重定向(双击警告)修复冲突后,每个工作正常。

I don't understand how this could be related my problem. 我不明白这怎么可能与我的问题有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM