Hey,
we created a new solution with the microservice template. As there is no default integration for create new Microservices with postgres we edited the template to automatically fitting our needs. Everything within the microservice creation itself is working as expected. Then we created some base tables within the abpsuite. The first issue that we had was that the suite is not fully compatible with blazor-webapp frontend. The blazor-webapp template is splitted into the client and the server side while creating a microservice solution. When we now add entities to our microservice the abpsuite creates the pages in a new empty folder (SolutionNameBlazor instead of SolutionName.Blazor.WebApp.(Client)). Additionally the suite tries to edit the MenuContributor and Manus files which are not existent in the new folder (for sure). So we created blank files and looked into the code that is generated. We matched the code succesfull to our Blazor-WebApp solution and the menupoint and Pages are loaded and displayed as expected. With postman we could fully check all generated REST-Actions with the microservice directly and it is working verry well. The problem is that we get an exception when we open one of the new pages in the frontend (find it below). It seemed that there is a problem with the dependency injection of the service. I could debug the constructor of our page but it run immediately after the constructor in the exception. Our test-solution is a bit over a gigabit in size and you could recreate the issue by simply following our steps above. I think that you could recreate the issue as well when you use MSSQL so the editing of the template is not nescessary to find the problems that we faced out.
-
Template: microservice
-
Created ABP Studio Version: 0.9.16
-
Current ABP Studio Version: 0.9.22
-
Multi-Tenancy: Yes
-
UI Framework: blazor-webapp
-
Theme: leptonx
-
Theme Style: system
-
Database Provider: ef
-
Database Management System: postgresql
-
Mobile Framework: none
-
Public Website: No
-
Include Tests: Yes
-
Dynamic Localization: Yes
-
Optional Modules:
-
GDPR
-
FileManagement
-
TextTemplateManagement
-
AuditLogging
-
Chat
-
OpenIddictAdmin
-
-
Exception message and full stack trace:
-
An unhandled exception occurred while processing the request.
InvalidOperationException: Cannot provide a value for property 'BotFlowsAppService' on type 'MeinWerk.Blazor.WebApp.Client.Pages.BotFlows'. There is no registered service of type 'MeinWerk.BotFlowService.BotFlows.IBotFlowsAppService'.
Microsoft.AspNetCore.Components.ComponentFactory+<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component)
Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable<int> parentComponentId)
Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId)
Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(ref DiffContext diffContext, int frameIndex)
Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(ref DiffContext diffContext, int frameIndex)
Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(ref DiffContext diffContext, int newFrameIndex)
Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(ref DiffContext diffContext, int oldStartIndex, int oldEndIndexExcl, int newStartIndex, int newEndIndexExcl)
Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, int componentId, ArrayRange<RenderTreeFrame> oldTree, ArrayRange<RenderTreeFrame> newTree)
Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, out Exception renderFragmentException)
Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(int componentId, RenderFragment renderFragment)
Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderRootComponentAsync(int componentId, ParameterView initialParameters)
Microsoft.AspNetCore.Components.HtmlRendering.Infrastructure.StaticHtmlRenderer.BeginRenderingComponent(IComponent component, ParameterView initialParameters)
Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.RenderEndpointComponent(HttpContext httpContext, Type rootComponentType, ParameterView parameters, bool waitForQuiescence)
System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>.GetResult()
Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext+<>c+<<InvokeAsync>b__10_0>d.MoveNext()
Microsoft.AspNetCore.Builder.ServerRazorComponentsEndpointConventionBuilderExtensions+<>c__DisplayClass1_1+<<AddInteractiveServerRenderMode>b__1>d.MoveNext()
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Volo.Abp.AspNetCore.Security.Claims.AbpDynamicClaimsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext()
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Microsoft.AspNetCore.Components.ComponentFactory+<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component) -
Steps to reproduce the issue:
-
See above
3 Answer(s)
-
0
Hi, as far as I understand, you did not generate-proxy after Suite code generation, right?
You should generate C# proxies, as described in the Microservice Tutorial, here is the link for the related section: https://abp.io/docs/latest/tutorials/microservice/part-03#generating-the-ui-proxy
Please, follow this section and let me know if it's fixed.
Best regards. -
0
Hi, no - of course we created the c# proxys after we created the entites and let the Suite do the code creation.
-
0
Indeed there is a problem as you stated. I will create an internal issue for this problem.
However, for a quick workaround you can apply the following instructions:
1-) Open the appsettings.json file (it's under the %%user-profile%%.abp\suite) and manually fix the following parts in the solution section:
Change UiFramework to 7, set the BlazorWebAppProjectDirectory as your project directory:
//... "Name": "<YourMicroserviceName>", "UiFramework": 7, //... "BlazorWebAppProjectDirectory": "<your-directory-structure>\\apps\\blazor", "UiFrameworkName": "BlazorWebApp"
This will fix the code generation path but the menu item creation still be problematic and give errors. So for now, I suggest you to generate everything except the UI, and wait for the next patch. In the next version, once we fix this problem, you can regenerate it with the UI.
Sorry for the trouble. Regards.