Base solution for your next web application

Activities of "hongbing.wang"

After upgrading to ASP.NET Zero 12.4.2, record count dropdown list has extra white padding when expanded. See the screenshot below. Please note that the Angular client version shows 12.4.0. We can reproduce it by deleting node_modules and rebuild.

With the original source for 12.4.2, if the client version shows 12.0.0, it doesn't have the issue.

Please investigate this dependency issue.

The issue happens to Zero app 12.4.2 and our web app if you remove the yarn.lock, delete node_modules folder and regenerate it.

The versions: Angular 16 and PrimeNG 16.4.1

  • Angular 16 and PrimeNG 16.4.1: The element count display seems to be a default behavior in this combination, without an explicit disabling option.
  • Downgrading to PrimeNG 15: While this removes the count, it introduces dependency warnings, indicating potential compatibility issues.

Please advise how to resolve the issue. Thank you.

Adding <PackageReference Include="Castle.Core-Serilog" Version="5.1.1" /> to ServiceCore,Host project made the error go away.

After upgrading to ASP.NET Zero 12.4.2, in production build, I got the following exception with running umsplus.ServiceCore.Host.exe. Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Castle.Services.Logging.SerilogIntegration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'. The system cannot find the file specified. File name: 'Castle.Services.Logging.SerilogIntegration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at Serilog.Settings.Configuration.ConfigurationReader.LoadConfigurationAssemblies(IConfiguration section, AssemblyFinder assemblyFinder) at Serilog.Settings.Configuration.ConfigurationReader..ctor(IConfiguration configSection, AssemblyFinder assemblyFinder, ConfigurationReaderOptions readerOptions, IConfiguration configuration) at Serilog.ConfigurationLoggerConfigurationExtensions.GetConfigurationReader(IConfiguration configuration, ConfigurationReaderOptions readerOptions, DependencyContext dependencyContext) at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, ConfigurationReaderOptions readerOptions) at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext) at umsplus.ServiceCore.ServiceCoreAppModule.PreInitialize() in E:\jenkins_ws\workspace\WmsPLUS_Developement\trunk\services\ServiceCore.Host\ServiceCoreAppModule.cs:line 50 at Abp.Modules.AbpModuleManager.<>c.<StartModules>b__15_0(AbpModuleInfo module) at System.Collections.Generic.List1.ForEach(Action1 action) at Abp.Modules.AbpModuleManager.StartModules() at Abp.AbpBootstrapper.Initialize() at umsplus.ServiceCore.Program.<>c.<CreateHostBuilder>b__2_1(IServiceCollection services) in E:\jenkins_ws\workspace\WmsPLUS_Developement\trunk\services\ServiceCore.Host\Program.cs:line 54 at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at umsplus.ServiceCore.Program.Main(String[] args) in E:\jenkins_ws\workspace\WmsPLUS_Developement\trunk\services\ServiceCore.Host\Program.cs:line 31 at umsplus.ServiceCore.Program.<Main>(String[] args)

However, dotnet umsplus.Web.Host.dll runs fine.

In our production build, umsplus.ServiceCore.Host.exe and umsplus.Web.Host.dll are in the same folder sharing the same Castle.Services.Logging.SerilogIntegration.dll.

The version of Castle.Services.Logging.SerilogIntegration.dll in the folder is 5.1.1.

nuget package castle.core-serilog\5.1.1\lib\net6.0\Castle.Services.Logging.SerilogIntegration.dll, the latest version 5.1.1.

<PackageReference Include="Castle.Core-Serilog" Version="5.1.1" />

The dependency:

umsplus.Web.Host -> umsplus.Web.Core -> umsplus.EntityFrameworkCore -> umsplus.Core -> Abp.ZeroCore.EntityFrameworkCore 8.4.0 -> Abp.ZeroCore 8.4.0 -> Abp.Zero.Common 8.4.0 -> Abp 8.4.0 -> Castle.Core (>= 5.1.1) umsplus.Web.Host -> Castle.Core-Serilog 5.1.1 -> Castle.Core (= 5.1.1).

The decompiler info on Castle.Services.Logging.SerilogIntegration.dll.

#region Assembly Castle.Services.Logging.SerilogIntegration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc // C:\Users&lt;username>.nuget\packages\castle.core-serilog\5.1.1\lib\net6.0\Castle.Services.Logging.SerilogIntegration.dll // Decompiled with ICSharpCode.Decompiler 8.1.1.7464 #endregion

Not sure why there is a version conflict / mismatch 5.0.0.0 and 5.1.1.

In debug build, umsplus.ServiceCore.Host.exe and umsplus.Web.Host.dll run is separate folder. They run fine without the version conflict issue.

The requirement: “API documentation should be available from a folder/url within WMS Pro (e.g. /apidoc). This folder would serve as the root folder for the API documentation, so that it can be filled out with multiple pages and resources independent of the main WMS Pro app.”

Our Zero app's server and angular client are within the same application. We aim to incorporate a folder for HTML documentation for APIs, allowing access from outside the Zero web app.

I’ve created a new folder under \server\wwwroot\apidoc.

Initial attempt in Configure() of Startup.cs (in ASP.NET Core):

`#if HTTPONLY_COOKIE && RELEASE app.Use(async (context, next) => { if (context.Request.Path.HasValue && context.Request.Path.Value.StartsWith("/apidoc")) { // Rewrite the request to remove the '/apidoc' prefix context.Request.Path = context.Request.Path.Value.Substring("/apidoc".Length); await next(); } else { await next(); } });

        app.UseStaticFiles(); // Assuming this middleware is for serving static files

        app.Use(async (context, next) =>
        {
            if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
            {
                context.Request.Path = "/index.html";
                await next();
            }
        });

#endif`

FYI: The existing code was: `#if HTTPONLY_COOKIE && RELEASE app.Use(async (context, next) => { await next(); if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value)) { context.Request.Path = "/index.html"; await next(); } }); #endif

        app.UseStaticFiles();`

The problem: "\apidoc" was always redirected by the ‘catch all’ route of the angular app. The intended ASP.NET Core rewrite didn't work as expected.

Please advise how to resolve the issue.

Thank you for your support.

This issue has been resolved.

Hi ismcagdas,

We tried it in a couple of AppService classes. We also tried it in TokenAuthController.cs. The errors are similar, for example, "Can't create component 'umsplus.Web.Controllers.TokenAuthController' as it has dependencies to be satisfied".

We have found other ways to dynamic show/hide menu items and permission tree items in app-navigation.service.ts, PermissionAppService and RoleAppService.

Hi ismcagdas, Thank you. I tried injecting IPermissionDefinitionContext through constructor and getting any permission using its GetPermissionOrNull method. But I got the runtime error "Can't create component as it has dependencies to be satisfied". What else do I need to implement? Can I inject IPermissionDefinitionContext in any app service?

I think we already did it in AppAuthProviderExtension, but this method is only called once on application startup.

Can we override the "auth" response for this call: https://localhost:44301/AbpUserConfiguration/GetAll?d=1687166682491

Using SQL Server Management Studio (SSMS), I am able to copy an encrypted password from any Operator on an installation into any other Operator on any installation (same machine / installation, completely different machine / installation).

To replicate:

On Computer A

Create a new Operator and give them any password

Open SSMS > dbo.AbpUsers, show top 1000 (for example)

Locate the newly created Operator, copy the value in the ‘Password’ field

On Computer B

Open SSMS > dbo.AbpUsers, edit top 200 (for example - edit required)

Locate the admin user (typically entry #2)

Delete the value in the ‘Password’ field, and replace with the copied value from Computer A

Press the Enter key to save the change to the database

Log in using the ‘admin’ Operator, but use the password you created for the new Operator on Computer A

Log in should be successful

No evidence of tampering, no warning, no errors, it just works.

Expected behaviour is that simply copying any encrypted password from one Operator to another - ESPECIALLY on a completely different installation - should NOT allow the login to work.

What's the cause of the issue? Does ASP.NET Zero use ASP.NET Identity framework PasswordHasher? By default, is there a salt? Please confirm that user passwords are hashed with salt. Is there a configuration available to resolve the issue?

Hi support team,

We need to find a way to access the AppPermissions.Pages permission, the root of the permission tree, and dynamically add or remove a root menu item. Please advise which method we should use.

I tried with the following code. The problem is role.Permissions is null, but the user’s role does have permissions, see the screenshot. What did I miss?

    private async Task RemoveAlarmPermissionsAsync()
    {
        var roleId = (int)AbpSession.UserId;
        var role = await _roleManager.GetRoleByIdAsync(roleId);
        var permissions = PermissionManager.GetAllPermissions();
        var rootAlarmPermission = permissions.Where(p => p.Name == "Pages.Alarms").FirstOrDefault();
        if (role.Permissions != null && rootAlarmPermission != null)
        {
            //remove Pages.Alarms from the root permission tree
            var alarmRolePermissionSetting = new RolePermissionSetting
            {
                TenantId = _tenantId,
                Name = "Pages.Alarms",
                IsGranted = true,
                RoleId = roleId
            };

            role.Permissions.Remove(alarmRolePermissionSetting);
        }
    }

Showing 11 to 20 of 31 entries