如何调试在其堆栈跟踪中没有我的代码痕迹的代码?

时间:2017-02-13 11:10:40

标签: c# debugging asp.net-web-api web

我有一个Web API应用程序,我收到此错误:

at System.Collections.Generic.List`1.Enumerator.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__58`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at System.Web.Http.Services.DefaultServices.GetServices(Type serviceType)
at System.Web.Http.ServicesExtensions.GetServices[TService](ServicesContainer services)
at System.Web.Http.ModelBinding.ModelBinderAttribute.GetModelBinderProvider(HttpConfiguration configuration)
at System.Web.Http.ModelBinding.ModelBinderAttribute.GetModelBinder(HttpConfiguration configuration, Type modelType)
at System.Web.Http.ModelBinding.ModelBinderAttribute.GetBinding(HttpParameterDescriptor parameter)
at System.Web.Http.ModelBinding.DefaultActionValueBinder.GetParameterBinding(HttpParameterDescriptor parameter)
at System.Array.ConvertAll[TInput,TOutput](TInput[] array, Converter`2 converter)
at System.Web.Http.ModelBinding.DefaultActionValueBinder.GetBinding(HttpActionDescriptor actionDescriptor)
at System.Web.Http.Tracing.Tracers.ActionValueBinderTracer.System.Web.Http.Controllers.IActionValueBinder.GetBinding(HttpActionDescriptor actionDescriptor)
at System.Web.Http.Controllers.HttpActionDescriptor.get_ActionBinding()
at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem..ctor(HttpControllerDescriptor controllerDescriptor)
at System.Web.Http.Controllers.ApiControllerActionSelector.GetInternalSelector(HttpControllerDescriptor controllerDescriptor)
at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)
at System.Web.Http.Tracing.Tracers.HttpActionSelectorTracer.<>c__DisplayClass2.<System.Web.Http.Controllers.IHttpActionSelector.SelectAction>b__0()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEnd(ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Action execute, Action`1 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.HttpActionSelectorTracer.System.Web.Http.Controllers.IHttpActionSelector.SelectAction(HttpControllerContext controllerContext)
at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__18`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()

此处不显示我的代码部分。我该怎么调试呢?

我已经通过AppDomain.CurrentDomain.UnhandledException完成了一个全局异常处理程序并且没有被命中。我已经为Web API添加了自定义的ExceptionFilter,并且再次针对此错误未执行此操作。

我不知道如何调试它。你能帮忙吗?

0 个答案:

没有答案