[英]OWIN Startup: Entry point was not found
執行UseWebApi()
時,我的OWIN Startup
配置中拋出以下EntryPointNotFoundException
:
System.Web.Http.Owin.dll中出現“System.EntryPointNotFoundException”類型的異常,但未在用戶代碼中處理
附加信息:未找到入口點。
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通過添加綁定重定向(雙擊警告)修復沖突后,每個工作正常。
我不明白這怎么可能與我的問題有關。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.