Ends in:
7 DAYS
15 HRS
35 MIN
34 SEC
Ends in:
7 D
15 H
35 M
34 S
Open Closed

How to use cms kit as service in microservice template? #1596


User avatar
0
hitaspdotnet created

Is it possible?


6 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    you can create a new service in your microservice solution. and add Cms-Kit to your new service.

  • User Avatar
    0
    hitaspdotnet created

    and add Cms-Kit to your new service.

    This is my question! How? In my scenario I need cms features for our clients as remote service and should avaible for tenant admin to manage it. What about UI for public and admin web.

  • User Avatar
    0
    hitaspdotnet created

    any answer?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Just like SaasService

    you can create a CmsService project and intall nuget packages:

    • Volo.CmsKit.Pro.Admin.Application.Contracts
    • Volo.CmsKit.Pro.Admin.Application
    • Volo.CmsKit.Pro.Admin.HttpApi
    • Volo.CmsKit.Pro.Admin.HttpApi.Client
    • Volo.CmsKit.Pro.Application
    • Volo.CmsKit.Pro.Application.Contracts
    • Volo.CmsKit.Pro.Domain
    • Volo.CmsKit.Pro.Domain.Shared
    • Volo.CmsKit.Pro.EntityFrameworkCore
    • Volo.CmsKit.Pro.HttpApi
    • Volo.CmsKit.Pro.HttpApi.Client
    • Volo.CmsKit.Pro.Public.Application
    • Volo.CmsKit.Pro.Public.Application.Contracts
    • Volo.CmsKit.Pro.Public.HttpApi
    • Volo.CmsKit.Pro.Public.HttpApi.Client

    For UI, Add the following packages:

    Volo.CmsKit.Pro.Public.Web to PublicWeb, Volo.CmsKit.Pro.Admin.Web to Web.

    Update gateways and appsettings.json

    Open IdentityServerDataSeeder to add CmsService apiResource and apiScope.

  • User Avatar
    0
    hitaspdotnet created

    Service's api and gateways works fine but the public site and dashboard has DI error

    2021-08-07 14:09:55.305 +04:30 [ERR] ---------- RemoteServiceErrorInfo ----------
    {
      "code": null,
      "message": "An internal error occurred during your request!",
      "details": null,
      "data": {
        "ActivatorChain": "Volo.CmsKit.Admin.Pages.PageAdminController"
      },
      "validationErrors": null
    }
    
    2021-08-07 14:09:55.305 +04:30 [ERR] An exception was thrown while activating Volo.CmsKit.Admin.Pages.PageAdminController.
    Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.CmsKit.Admin.Pages.PageAdminController.
     ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Volo.CmsKit.Admin.Pages.PageAdminController' can be invoked with the available services and parameters:
    Cannot resolve parameter 'Volo.CmsKit.Admin.Pages.IPageAdminAppService pageAdminAppService' of constructor 'Void .ctor(Volo.CmsKit.Admin.Pages.IPageAdminAppService)'.
       at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
       at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
       at Autofac.Core.Activators.Reflection.ReflectionActivator.<ConfigurePipeline>b__11_0(ResolveRequestContext ctxt, Action`1 next)
       at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
       at Autofac.Builder.RegistrationBuilder`3.&lt;&gt;c__DisplayClass41_0.&lt;PropertiesAutowired&gt;b__0(ResolveRequestContext ctxt, Action`1 next)
       at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
       --- End of inner exception stack trace ---
       at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
       at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
       at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
       at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
       at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request)
       at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
       at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
       at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
       at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    2021-08-07 14:09:55.306 +04:30 [ERR] ---------- Exception Data ----------
    ActivatorChain = Volo.CmsKit.Admin.Pages.PageAdminController
    
  • User Avatar
    0
    hitaspdotnet created

    My bad, missed CmsServiceHttpApiClientModule DependsOn for web modules

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06