我创建了一个 servicestack MVC 项目,我将其用作数据库的主要 API。因为我想在我的代码中访问模型,所以我还在我的 MVC Views Project 和 Controllers 项目中添加了对该项目的引用。
但是,当我运行我的项目 [网站项目] 时,我遇到了真正的问题,ServiceStack 认为它拥有我的解决方案,并接管了所有请求,然后无法解决我的路线。
我已经在 web 项目全局文件中添加了路由,我也尝试将这些路由添加到 servicestack 项目,但仍然无法解决。
这是错误:
[ResolutionException: Required dependency of type uyr.print.controllers.Controllers.UsersController could not be resolved.]
Funq.Container.ThrowMissing(String serviceName) in C:\src\ServiceStack\src\ServiceStack\Funq\Container.cs:297
Funq.Container.GetEntry(String serviceName, Boolean throwIfMissing) in C:\src\ServiceStack\src\ServiceStack\Funq\Container.cs:275
Funq.Container.ResolveImpl(String name, Boolean throwIfMissing) in C:\src\ServiceStack\src\ServiceStack\Funq\Container.cs:112
Funq.Container.ResolveNamed(String name) in C:\src\ServiceStack\src\ServiceStack\Funq\Container.Overloads.cs:283
Funq.Container.Resolve() in C:\src\ServiceStack\src\ServiceStack\Funq\Container.Overloads.cs:230
lambda_method(Closure , Container ) +41
ServiceStack.ServiceHost.ContainerResolveCache.CreateInstance(Type type, Boolean tryResolve) in C:\src\ServiceStack\src\ServiceStack\ServiceHost\ContainerResolveCache.cs:62
ServiceStack.ServiceHost.ContainerResolveCache.CreateInstance(Type type) in C:\src\ServiceStack\src\ServiceStack\ServiceHost\ContainerResolveCache.cs:37
ServiceStack.Mvc.FunqControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in C:\src\ServiceStack\src\ServiceStack.FluentValidation.Mvc3\Mvc\FunqControllerFactory.cs:38
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +232
System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +49
System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +13
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +124
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +98
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970356
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
如果有人能在这里指出我正确的方向,将不胜感激。
谢谢