突然,我开始在我的ServiceStack MVC服务应用程序中遇到错误,如下所示:
{"The given key was not present in the dictionary."}
System.Exception {System.Collections.Generic.KeyNotFoundException}
和StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at ServiceStack.WebHost.Endpoints.Utils.FilterAttributeCache.GetRequestFilterAttributes(Type requestDtoType) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\Utils\FilterAttributeCache.cs:line 44
at ServiceStack.WebHost.Endpoints.EndpointHost.ApplyRequestFilters(IHttpRequest httpReq, IHttpResponse httpRes, Object requestDto) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\EndpointHost.cs:line 201
at ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\RestHandler.cs:line 79
at ServiceStack.WebHost.Endpoints.Support.EndpointHandlerBase.ProcessRequest(HttpContext context) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\Support\EndpointHandlerBase.cs:line 150
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
我不知道错误是什么,也不知道错误是什么。我的应用程序工作了,但现在不工作了。
你知道怎么解决这个问题吗?
编辑1:当我在When浏览器中浏览服务url时,调试器永远不会访问我的服务类和Run
方法。
发布于 2012-09-10 13:09:39
我收到这个错误是因为在路由中使用了错误的模型。
所以:
Routes.Add<ModelA>("/path/to/service");
应该是
Routes.Add<ModelB>("/path/to/service");
https://stackoverflow.com/questions/12134588
复制相似问题