Project type: Blazor server Abp version: 9.1.1 Blazorise.Icons.FontAwesome Version: 1.7.6 Volo.Abp.AspNetCore.Components.Server.LeptonXTheme: 4.1.1
What fontawesome package should be used after upgrading to abp 9.1? Icons used in the project are correct but when using UiMessageService.Error the dialog displays the wrong error icon.
There's an old solution but if I downgrade I get wrong icons everywhere https://abp.io/support/questions/7128/Wrong-fontawesome-icon-on-Blazor-UI-after-update-all-blozorrize-package
Create a new ABP Blazor Server application. Create a simple entity to use for the extension property. Configure the extra property for IdentityUser in ExtensionConfigurator. Override the UserManagement razor component with the source code from the module. Run the application and navigate to the Identity Users management page. Open the Create or Edit User modal. Select an option from the dropdown field. Click outside of the field to lose focus. Click back into the field and select another option. The selected value does not clear and is duplicated/added to each time.
Is there a known issue with dropdown extension properties in Blazor Server, and how can we ensure the selection clears correctly? Could this be related to overriding the UserManagement component? Looking at the code for LookupExtensionProperty.razor.cs we think it could be related to how items are added when parameters are set.
protected override void OnParametersSet()
{
var value = Entity.GetProperty(PropertyInfo.Name);
var text = Entity.GetProperty(TextPropertyName);
if (value != null && text != null)
{
lookupItems.Add(new SelectItem<object>
{
Text = Entity.GetProperty(TextPropertyName)!.ToString()!,
Value = value
});
}
}
Thanks
Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.
We are using ABP Commercial with Blazor Server and recently attempted to switch from the NuGet-based SaaS module (Volo.Saas) to the full source code version. However, we decided to revert back to the SaaS package reference.
After completing the migration back to Volo.Saas, we ensured all csproj and Module.cs files were correctly updated, and the solution builds without errors. The only difference in the Saas packages is that we were at Abp 8.0.2 when doing the initial switch to source code, now we are at 8.0.3. However, when logging into the host page, we get the following runtime error:
[2025-02-06T09:12:22.398Z] Error: System.InvalidOperationException: Cannot provide a value for property 'TenantAppService' on type 'Volo.Saas.Host.Blazor.Pages.Shared.Components.SaasLatestTenantsWidget.SaasLatestTenantsWidgetComponent'. There is no registered service of type 'Volo.Saas.Host.ITenantAppService'. at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component) at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable`1 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Despite reverting to Volo.Saas, ITenantAppService is not being registered, causing an injection failure in Blazor components. Removing the widget lets us try navigate to the Editions section and there the we get this error:
System.InvalidOperationException: Cannot provide a value for property 'AppService' on type 'Volo.Saas.Host.Blazor.Pages.Saas.Host.EditionManagement'. There is no registered service of type 'Volo.Saas.Host.IEditionAppService'.
Could you clarify why ITenantAppService and IEditionAppService is not available after switching back to the SaaS package reference?
Are there additional dependencies we may have missed?
Do we need to manually reset or reconfigure something?
Is this a known issue when reverting from source code to package reference?
Any help or guidance on how to resolve this issue would be greatly appreciated. Thanks!
ABP Framework version: v9.0.2
UI Type: Blazor Server
Database System: EF Core (SQL Server)
Tiered (for MVC) or Auth Server Separated (for Angular): no
Exception message and full stack trace:
Steps to reproduce the issue:
Create a new Abp solution with blazor server with multitenancy with working db connection + run dbmigrator
Comment out to not use the nullemailsender in debug mode
Install Mailkit in the Domain module (Since we get a warning if we try to send a test email without it)
Set up valid email credentials(sendgrid in our case) and send a test mail to email address X which is sent and recieved ok
Create a new user with the email X
Log out and try to use the forgot password function with the new users email, according to the UI an email is sent
No email is recieved in the user email X
Do we need to take any extra/other steps for the forgot password function to work since the test email is working fine?
Also, according to the Account Pro docs the module implements email confirmation. We have not gotten this to work either, no confirmation email is sent to the new user(With and without email confirmed box checked). Do we need to implement this ourselves? This also applies to when we register a new tenant, no confirmation email is sent to the admin email address. So if you could explain what we can expect to work out of the box when creating a abp project and what we need to implement ourselves regarding this that would be appriciated! Thanks!
Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.
1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 json, JsonDocumentOptions options)
at Volo.Abp.BlazoriseUI.Components.ObjectExtending.LookupExtensionProperty2.GetLookupItemsAsync(String filter) at Volo.Abp.BlazoriseUI.Components.ObjectExtending.LookupExtensionProperty2.SearchFilterChangedAsync(String filter)
at Volo.Abp.BlazoriseUI.Components.ObjectExtending.LookupExtensionProperty`2.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty\<int?>(
"SupplierId",
property =>
{
property.UI.Lookup.Url = "/api/app/suppliers";
property.UI.Lookup.DisplayPropertyName = "companyName";
}
);
});
});
Create MyBlazorServerLookupApiRequestService.cs as mentioned in https://abp.io/support/questions/6195/Extension-property-in-Identity-Users-not-working-in-Azure When trying to access a modal which depends on the endpoint, you will get an null exception since HttpContext is null, remove the adding of headers according to this issue: https://abp.io/support/questions/8205/Extension-property-in-Identity-Users-not-working-in-Azure-6195 You will now get the loginpage as a result, instead of the json. How should we handle this to get access to the endpoint?
MyBlazorServerLookupApiRequestService.cs:
using System;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Abp;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.Web.Extensibility;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.MultiTenancy;
namespace LansenOnline.Blazor.Services;
[Dependency(ReplaceServices = true)]
public class MyBlazorServerLookupApiRequestService : 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<MyBlazorServerLookupApiRequestService> Logger { get; }
public MyBlazorServerLookupApiRequestService(IHttpClientFactory httpClientFactory,
IRemoteServiceHttpClientAuthenticator httpClientAuthenticator,
ICurrentTenant currentTenant,
IHttpContextAccessor httpContextAccessor,
NavigationManager navigationManager,
IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider,
ILogger<MyBlazorServerLookupApiRequestService> 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)
// {
// 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));
}
}
}
Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.
Hello, we are trying to override the Account/Default.cshtml in the .Host project to customize it. We have followed the steps in the docs: https://abp.io/docs/commercial/6.0/themes/lepton-x/commercial/mvc#account-layout We are using the same code for the Default.cshtml as found when downloading the code for the LeptonX module.
The override is partially working, but we are now missing some js functionallity and the logo and background images. The background image could be found by changing the path slightly. But we cant find a solution to all the js scripts not being loaded. We suspect that the problem is with the bundling of the scripts:
<abp-script-bundle name="@LeptonXThemeBundles.Scripts.Global" />
The logs from the console when accessing the login page:
Uncaught ReferenceError: $ is not defined at ApplicationLocalizationScript?cultureName=en:3:1 at ApplicationLocalizationScript?cultureName=en:3050:3
Uncaught ReferenceError: $ is not defined at ApplicationConfigurationScript:3:1 at ApplicationConfigurationScript:313:3
Failed to load resource: the server responded with a status of 500 () ServiceProxyScript:1
Uncaught ReferenceError: $ is not defined at Login.js?_v=638693378107394850:1:1
Some js functionality is working, like the login button, but not the tenant switch of the language switch. What do we need to do to make the bundling work? Or is it another issue?