Hi,
We implemented the Blazor WebAssembly app as a SaaS model in microservice template on abp 7.2.2 version
Added a Chat Module as a package. but chat page not loading. getting the below issue.
- ABP Framework version: v7.2.2
- UI type: Blazor WebAssembly
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
31 Answer(s)
-
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
HI,
Can you share the error logs? Gateway and chat service. thanks.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi
Here are the logs,
**Chat Log: **
2023-06-08 17:32:26.217 +08:00 [INF] Request origin https://localhost:44307 does not have permission to access the resource. 2023-06-08 17:32:26.506 +08:00 [INF] Executing endpoint 'Volo.Chat.Users.ContactController.GetTotalUnreadMessageCountAsync (Volo.Chat.HttpApi)' 2023-06-08 17:32:26.526 +08:00 [INF] Route matched with {area = "chat", action = "GetTotalUnreadMessageCount", controller = "Contact"}. Executing controller action with signature System.Threading.Tasks.Task
1[System.Int32] GetTotalUnreadMessageCountAsync() on controller Volo.Chat.Users.ContactController (Volo.Chat.HttpApi). 2023-06-08 17:32:26.604 +08:00 [INF] Executing action method Volo.Chat.Users.ContactController.GetTotalUnreadMessageCountAsync (Volo.Chat.HttpApi) - Validation state: "Valid" 2023-06-08 17:32:26.768 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:b4b82d66-d14b-a8ac-fac8-3a0b83a99d0a,n:Chat.Messaging 2023-06-08 17:32:26.779 +08:00 [DBG] Found in the cache: pn:U,pk:b4b82d66-d14b-a8ac-fac8-3a0b83a99d0a,n:Chat.Messaging 2023-06-08 17:32:26.782 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Chat.Messaging 2023-06-08 17:32:26.788 +08:00 [DBG] Found in the cache: pn:R,pk:admin,n:Chat.Messaging 2023-06-08 17:32:26.790 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:Blazor,n:Chat.Messaging 2023-06-08 17:32:26.796 +08:00 [DBG] Found in the cache: pn:C,pk:Blazor,n:Chat.Messaging 2023-06-08 17:32:26.886 +08:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]" }, "validationErrors": null }2023-06-08 17:32:26.886 +08:00 [ERR] An exception was thrown while activating Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions
1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]. ---> Volo.Abp.AbpException: No configuration found for Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore, Version=7.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60! Use services.Configure<AbpDbContextOptions>(...) to configure it. at Volo.Abp.EntityFrameworkCore.DependencyInjection.DbContextOptionsFactory.Configure[TDbContext](AbpDbContextOptions options, AbpDbContextConfigurationContext1 context) at Volo.Abp.EntityFrameworkCore.DependencyInjection.DbContextOptionsFactory.Create[TDbContext](IServiceProvider serviceProvider) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.<ConfigurePipeline>b__2_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 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, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.GetDbContextAsync() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetDbSetAsync() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetQueryableAsync() at Volo.Chat.EntityFrameworkCore.Conversations.EfCoreConversationRepository.GetTotalUnreadMessageCountAsync(Guid userId, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Chat.Users.ContactAppService.GetTotalUnreadMessageCountAsync() at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method1301(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2023-06-08 17:32:26.888 +08:00 [ERR] ---------- Exception Data ---------- ActivatorChain = Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions`1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
No configuration found for Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore, Version=7.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60! Use services.Configure<AbpDbContextOptions>(...) to configure it.
You are installing the chat module to product service, right? You can try:
public class ProductServiceDbContext : AbpDbContext<ProductServiceDbContext>, IChatDbContext .... context.Services.AddAbpDbContext<ProductServiceDbContext>(options => { options.ReplaceDbContext<IChatDbContext>(); options.AddDefaultRepositories(includeAllEntities: true); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
You need to configure the SignalR URL.
For example:
Configure<ChatBlazorWebAssemblyOptions>(options => { options.SignalrUrl = builder.Configuration["RemoteServices:Chat:BaseUrl"]; });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
You need to configure the SignalR URL.
For example:
Configure<ChatBlazorWebAssemblyOptions>(options => { options.SignalrUrl = builder.Configuration["RemoteServices:Chat:BaseUrl"]; });Hi,
Where i should write this line Product service? and should i update anything in app settings of Product service?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
You should write this in the
Blazorapp.and should i update anything in app settings of Product service?
No, you don't.
Could not find VoloChatAvatarManager.createCanvasForUser
You can try running the
abp bundlecommand in the Blazor app folder.Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
It's just an example; you should replace the
builder.Configuration["RemoteServices:Chat:BaseUrl"];with the real URL.Gateway URL or Product service URL.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Update the gateway config file:
{ "ServiceKey": "Signalr Service", "DownstreamPathTemplate": "/signalr-hubs/{everything}", "DownstreamScheme": "wss", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44361 } ], "UpstreamPathTemplate": "/signalr-hubs/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] },Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
Can you share the project with me? I will check it out
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
My email is shiwei.liang@volosoft.com
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Sorry, I am missing a verb.
You can remove the
UpstreamHttpMethodto allow any verbs:{ "ServiceKey": "Signalr Service", "DownstreamPathTemplate": "/signalr-hubs/{everything}", "DownstreamScheme": "wss", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44361 } ], "UpstreamPathTemplate": "/signalr-hubs/{everything}" }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
Can you share the project with me? shiwei.liang@volosoft.com, I will check it out. I think this can save you time.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
I uploaded and shared the source code to you email id shiwei.liang@volosoft.com.
you may check.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Steps:
- Update the appsettings.json
"RemoteServices": { "AbpIdentity": { "BaseUrl": "https://localhost:44388/", "UseCurrentAccessToken": "false" } }, "IdentityClients": { "Default": { "GrantType": "client_credentials", "ClientId": "AdministrationService", "ClientSecret": "1q2w3e*", "Authority": "https://localhost:44322", "Scope": "IdentityService", "RequireHttps": "true", "ValidateIssuerName": "true", "ValidateEndpoints ": "true" } },- Grant user lookup permission to AdministrationService
You can create an application named
ProductServiceinstead of usingAdministrationService- Add package references
<PackageReference Include="Volo.Abp.Identity.Pro.HttpApi.Client" Version="7.2.2" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="7.2.2" />
[DependsOn(typeof(AbpHttpClientIdentityModelWebModule))] [DependsOn(typeof(AbpIdentityHttpApiClientModule))] public class ProductServiceHttpApiHostModule : AbpModule- Update
ProductServiceHttpApiHostModule
public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Use(async (httpContext, next) => { var accessToken = httpContext.Request.Query["access_token"]; var path = httpContext.Request.Path; if (!string.IsNullOrEmpty(accessToken) && (path.StartsWithSegments("/signalr-hubs/chat"))) { httpContext.Request.Headers["Authorization"] = "Bearer " + accessToken; } await next(); }); ........ }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
Now Application loading and chat working.
but may i know why we should use web reference in host module?
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="7.2.2" />
since my project is Blazor web assembly.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Because the product service needs to load user information from the identity service and the package was added to
ProductService.HttpAPI.Hostnot the Blazor app.Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)















