Search code examples
configurationaspnetboilerplate

Multiple projects for Application Services in ASP.NET Boilerplate


I have an application with two projects that contain IApplicationService classes, but the framework only resolves client proxies (in JavaScript: abp.services.app.xxxx) by default for Application project that comes with base template.

myProject.Application => default ASP.NET Boilerplate
myProject.ExtraServices => my own (not generating client proxies)

Thanks.


Solution

  • ASP.NET Core

    Create controllers for your ExtraServices project in MyProjectWebCoreModule:

    Configuration.Modules.AbpAspNetCore()
        .CreateControllersForAppServices(
            typeof(ExtraServicesModule).GetAssembly()
        );
    

    ASP.NET MVC 5

    Create controllers for your ExtraServices project in MyProjectWebApiModule:

    Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
        .ForAll<IApplicationService>(typeof(ExtraServicesModule).Assembly, "app")
        .Build();