我有一个使用webapi和autofac的sitecore站点(6.6)。该网站本身工作正常,但当我尝试在api控制器上进行任何操作时,我得到以下问题。我觉得我缺少一些配置或库,但web.config和二进制文件看起来一样。这是在.net 4.0,我相信支持WebApi
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +298
System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +38
System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +310
System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +99
System.Web.Http.WebHost.HttpControllerHandler.BeginProcessRequest(HttpContextBase httpContextBase, AsyncCallback callback, Object state) +203
System.Web.Http.WebHost.HttpControllerHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9048532
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
我很困惑,有什么想法吗?
提前致谢
威尔
答案 0 :(得分:0)
我有与此相同的设置和问题。
这是由在Windows Server 2008上运行引起的,没有无扩展名的URL支持。
您可以通过安装Microsoft的KB980368修补程序来使其正常运行。如果您运行的是Windows Server 2008R2,则它包含在Service Pack 2中。