Base solution for your next web application
Open Closed

Add Separated Project per Area MVC #4015


User avatar
0
reyada created

I use the below link to add the new project in the solution and reference the DLL into Main Web "ASPZero Web" <a class="postlink" href="https://stackoverflow.com/questions/12911006/asp-net-mvc-4-areas-in-separate-projects-not-working-view-not-found">https://stackoverflow.com/questions/129 ... -not-found</a>

But the problem the side hanging,

what is the missing if ASP Zero support that? what the best way to do that ?


2 Answer(s)
  • User Avatar
    0
    reyada created

    Server Error in '/' Application.

    No component for supporting the service Global.Areas.Global.Controllers.HomeController was 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: Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service Global.Areas.Global.Controllers.HomeController was 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:

    [ComponentNotFoundException: No component for supporting the service Global.Areas.Global.Controllers.HomeController was found] Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) +78 Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) +14 Castle.Windsor.WindsorContainer.Resolve(Type service) +13 Abp.Dependency.IocManager.Resolve(Type type) +38 Abp.Web.Mvc.Controllers.WindsorControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +69 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +88 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +195 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +443 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2110.0

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Reyada,

    You can create a new Area and put your controllers in it, there is no problem on that in AspNet Zero. For the error message you are getting, you need to define your Controllers like this:

    public class HomeController : [YourProjectName]ControllerBasw
    {
    ....
    }
    

    Otherwise, new controllers will not be registered to dependency injection.