我正在研究asp.net web API,我正在尝试调用API方法。我在调用mvc4中的API方法时遇到此异常。请帮我找出我的错误。因为我对asp.net中的WEB API很新。
我为该方法调试了调试器。它根本没有击中它,相反它显示异常。任何建议都被接受。
例外是:
0.0054464
这是控制器代码:
Entry point was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.EntryPointNotFoundException: Entry point was not found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[EntryPointNotFoundException: Entry point was not found.]
System.Web.Http.Dependencies.IDependencyScope.GetServices(Type serviceType) +0
System.Web.Http.Services.DefaultServices.GetServices(Type serviceType) +131
System.Web.Http.ServicesExtensions.GetServices(ServicesContainer services) +63
System.Web.Http.ServicesExtensions.GetExceptionLoggers(ServicesContainer services) +26
System.Web.Http.ExceptionHandling.ExceptionServices.CreateLogger(ServicesContainer services) +29
System.Web.Http.Controllers.ServicesContainer.CreateExceptionServicesLogger() +21
System.Lazy`1.CreateValue() +180
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +26
System.Lazy`1.get_Value() +11741313
System.Web.Http.ExceptionHandling.ExceptionServices.GetLogger(ServicesContainer services) +38
System.Web.Http.ExceptionHandling.ExceptionServices.GetLogger(HttpConfiguration configuration) +40
System.Web.Http.HttpServer.get_ExceptionLogger() +32
System.Web.Http.<SendAsync>d__0.MoveNext() +691
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28
System.Web.Http.WebHost.<ProcessRequestAsyncCore>d__0.MoveNext() +359
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +71
System.Web.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +11
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9644097
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
我使用以下网址调用web api方法: http://localhost:30543/api/Levels/GetAllPublishedLevel?submoduleId=3&parentId=2