Hi there,
Unfortunately the issue still exists. Still got NullReferenceException. Why? I checked the documentation and solutions in support forum. I created a custom LookupApiRequestService. See
and
[Extension property in Identity Users not working in Azure #6195](https://abp.io/support/questions/6195/Extension-property-in-Identity-Users-not-working-in-Azure)
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System;
using Volo.Abp.AspNetCore.Components.Web.Extensibility;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.Http.Client;
using Volo.Abp.MultiTenancy;
namespace NEXTjeugd.Blazor
{
[Dependency(ReplaceServices = true)]
public class CustomBlazorServerLookupApiRequestService : ILookupApiRequestService, ITransientDependency
{
public IHttpClientFactory HttpClientFactory { get; }
public IRemoteServiceHttpClientAuthenticator HttpClientAuthenticator { get; }
public IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; }
public ICurrentTenant CurrentTenant { get; }
public IHttpContextAccessor HttpContextAccessor { get; }
public NavigationManager NavigationManager { get; }
public ILogger<CustomBlazorServerLookupApiRequestService> Logger { get; }
public CustomBlazorServerLookupApiRequestService(IHttpClientFactory httpClientFactory,
IRemoteServiceHttpClientAuthenticator httpClientAuthenticator,
ICurrentTenant currentTenant,
IHttpContextAccessor httpContextAccessor,
NavigationManager navigationManager,
IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider,
ILogger<CustomBlazorServerLookupApiRequestService> logger)
{
HttpClientFactory = httpClientFactory;
HttpClientAuthenticator = httpClientAuthenticator;
CurrentTenant = currentTenant;
HttpContextAccessor = httpContextAccessor;
NavigationManager = navigationManager;
RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
Logger = logger;
}
public async Task<string> SendAsync(string url)
{
var client = HttpClientFactory.CreateClient();
var requestMessage = new HttpRequestMessage(HttpMethod.Get, url);
var uri = new Uri(url, UriKind.RelativeOrAbsolute);
if (!uri.IsAbsoluteUri)
{
var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultOrNullAsync("Default");
if (remoteServiceConfig != null)
{
// Blazor tiered mode
var baseUrl = remoteServiceConfig.BaseUrl;
client.BaseAddress = new Uri(baseUrl);
AddHeaders(requestMessage);
await HttpClientAuthenticator.Authenticate(new RemoteServiceHttpClientAuthenticateContext(client, requestMessage, new RemoteServiceConfiguration(baseUrl), string.Empty));
}
else
{
// Blazor server mode
client.BaseAddress = new Uri(NavigationManager.BaseUri);
foreach (var header in HttpContextAccessor.HttpContext!.Request.Headers.Where(x => x.Key != "Accept-Encoding"))
{
requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
}
}
}
var response = await client.SendAsync(requestMessage);
var responseString = await response.Content.ReadAsStringAsync();
Logger.LogInformation("Response: {0}", responseString);
return responseString;
}
protected virtual void AddHeaders(HttpRequestMessage requestMessage)
{
if (CurrentTenant.Id.HasValue)
{
requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString());
}
var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name;
if (!currentCulture.IsNullOrEmpty())
{
requestMessage.Headers.AcceptLanguage.Add(new(currentCulture));
}
}
}
}
Is there a solution for this?
ABP Framework version**: v8.2.3 UI Type**: Blazor Server Database System**: EF Core (SQL Server) Tiered (for MVC) Exception message and full stack trace**:
Hi there,
Got this exception sometimes. I can't reproduce it unfortunately.
2024-06-18 05:13:34.809 +00:00 [ERR] Unhandled exception in circuit '0Ii8lf77GLluHYmZrOx5tkCI26mNfhJH2DUyX1YmOpQ'.
System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Volo.Abp.ObjectMapping.DefaultObjectMapper.Map[TSource,TDestination](TSource source)
at Volo.Abp.LanguageManagement.DatabaseLanguageProvider.bDKc3J4YN()
at Volo.Abp.Caching.DistributedCache2.GetOrAddAsync(TCacheKey key, Func
1 factory, Func1 optionsFactory, Nullable
1 hideErrors, Boolean considerUow, CancellationToken token)
at Volo.Abp.LanguageManagement.DatabaseLanguageProvider.GetLanguagesAsync()
at Volo.Abp.AspNetCore.Components.Server.LeptonTheme.LeptonThemeToolbarContributor.ConfigureToolbarAsync(IToolbarConfigurationContext context)
at Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars.ToolbarManager.GetAsync(String name)
at Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components.ApplicationLayout.MainHeader.MainHeaderToolbar.OnInitializedAsync()
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
How to fix that?
ABP Framework version**: v5.3.0 UI Type**: Blazor Server Database System**: EF Core (SQL Server) Tiered (for MVC) Exception message and full stack trace**:
Hi there,
Got this exception sometimes. I can't reproduce it unfortunately. Only what I know is getting menu from MainMenuProvider.
Unhandled exception in circuit '0Ii8lf77GLluHYmZrOx5tkCI26mNfhJH2DUyX1YmOpQ'.
System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Volo.Abp.SettingManagement.Blazor.Settings.EmailingPageContributor.CheckPermissionsInternalAsync(SettingComponentCreationContext context)
at Volo.Abp.SettingManagement.Blazor.Settings.EmailingPageContributor.CheckPermissionsAsync(SettingComponentCreationContext context)
at Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.CheckAnyOfPagePermissionsGranted(SettingManagementComponentOptions settingManagementComponentOptions, SettingComponentCreationContext settingComponentCreationContext)
at Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.ConfigureMainMenuAsync(MenuConfigurationContext context)
at Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.ConfigureMenuAsync(MenuConfigurationContext context)
at Volo.Abp.UI.Navigation.MenuManager.GetInternalAsync(String name)
at Volo.Abp.UI.Navigation.MenuManager.GetAsync(String[] menuNames)
at Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components.ApplicationLayout.Navigation.MainMenuProvider.GetMenuAsync()
at NEXTjeugd.Blazor.Components.ApplicationLayout.MainHeader.OnInitializedAsync() in D:\a\1\s\src\NEXTjeugd.Blazor\Components\ApplicationLayout\MainHeader.razor.cs:line 30
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
2024-06-18 05:13:34.802 +00:00 [WRN] Unhandled exception rendering component: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
Sample code:
How to fix that?
ABP Framework version**: v5.3.0 UI Type**: Blazor Server Database System**: EF Core (SQL Server) Tiered (for MVC) Exception message and full stack trace**:
Hi there,
I got this exception
"Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object".
The same error occurred in the early version 5.3.0. Can somebody tell me how to fix that? ABP Framework version**: v8.1.3 UI Type**: Blazor Server Database System**: EF Core (SQL Server) Tiered (for MVC) Exception message and full stack trace**:
2024-06-12 10:59:32.885 +02:00 [ERR] Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e (Parameter 'item')
System.ArgumentException: Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e (Parameter 'item')
at Volo.Abp.Collections.TypeList`1.CheckType(Type item)
at Volo.Abp.Collections.TypeList`1.Add(Type item)
at Volo.Abp.Http.Modeling.ApiTypeNameHelper.GetSimpleTypeName(Type type, ITypeList duplicateTypes)
at Volo.Abp.Http.Modeling.ApiTypeNameHelper.GetSimpleTypeName(Type type)
at Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel.Create(ParameterInfo parameterInfo)
at System.Linq.Enumerable.SelectArrayIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
at Volo.Abp.Http.Modeling.ActionApiDescriptionModel.Create(String uniqueName, MethodInfo method, String url, String httpMethod, IList`1 supportedVersions, Nullable`1 allowAnonymous, String implementFrom)
at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.AddApiDescriptionToModel(ApiDescription apiDescription, ApplicationApiDescriptionModel applicationModel, ApplicationApiDescriptionModelRequestDto input)
at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.CreateApiModel(ApplicationApiDescriptionModelRequestDto input)
at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.CreateScript(ProxyScriptingModel scriptingModel)
at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.<>c__DisplayClass6_0.<GetScript>b__0()
at System.Collections.Generic.AbpDictionaryExtensions.<>c__DisplayClass7_0`2.<GetOrAdd>b__0(TKey k)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Volo.Abp.Http.ProxyScripting.ProxyScriptManagerCache.GetOrAdd(String key, Func`1 factory)
at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.GetScript(ProxyScriptingModel scriptingModel)
at Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll(ServiceProxyGenerationModel model)
at lambda_method6129(Closure, Object, Object[])
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
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()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Steps to reproduce the issue**: 1 Start the application 2 Check the log.txt
Hi there,
I have read the documentation about audit log. Each entity is derived from the base class FullAuditedAggregateRoot. I expect each change of an entity should appear in the audit log. As you can see I have configured UseAuditing in my BlazorModule.cs to enable audit logging.
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var env = context.GetEnvironment();
var app = context.GetApplicationBuilder();
var configuration = context.GetConfiguration();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAbpRequestLocalization();
if (!env.IsDevelopment())
{
app.UseErrorPage();
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "NEXTjeugd API");
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
app.UseWebDav(configuration);
}
I am only getting entries about Volo.Abp.Identity.IdentitySecurityLog which are created, but not changes. Why and how to accomplish that?
Kind regards, Tako Verkroost
ABP Framework version: v5.3.0 UI type: Blazor DB provider: EF Core Exception message and stack trace: Steps to reproduce the issue:"
Hello,
I am getting an error when I click on "Set Password". The same for "Two factor" Please can somebody tell me what's going on? I have also attached a screenshot
Kind regards, Tako Verkroost
Hi everbody,
I figured out that some characters are swallowed or disappeared if you type something in a textedit field box. There is some delay especially in a datepicker. What's going on?
Any help is appreciated.
Kind regards, Tako Verkroost
Hi everbody,
I figure out that the mouse onhover effect isn't workling. I set Hoverable="true". Tooltip shows: Adds a hover effect on when mousing over rows.
<DataGrid TItem="JeugdigeDto" Data="JeugdigeList" ReadData="OnDataGridReadAsync" TotalItems="TotalCount" ShowPager="true" Responsive="true" PageSize="PageSize" @bind-SelectedRow="@EditJeugdige" Hoverable="true">
Why isn't working? Can somebody help me out?
Kind regards, Tako Verkroost
Hi everybody,
I checked the documentation howto add a custom logo, but that didn't work. I changed the LogoUrl method to set logo: public class NEXTjeugdBrandingProvider : DefaultBrandingProvider { public override string AppName => "NEXTjeugd"; public override string LogoUrl => "/images/logo/Jel.png"; } Why isn't working? Can somebody help me out?
Kind regards, Tako Verkroost
Hi
I tried to use AbpHelper GUI but it crashing all the time without an error. Only what I see is a splash screen. What is going on? Can somebody help me out?
Kind regards, Tako Verkroost