Activities of "raif"

Hello, It seems that confirmation support with an empty phone number has been added for the 9.3.2 Identity Pro module.

There is an unit test named Create_PhoneNumberConfirmed_With_Empty_PhoneNumber() has been created, but the [Fact] attribute is missing.

After adding [Fact] attribute and running the test, the Create method in the IdentityUserAppService service is failing.

I'm not sure if the implementation is wrong or the test is wrong. Could you check it?

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSettingProvider.cs

Is there a special reason why EmailSettingProvider is internal but not public ?

  • Exception message and full stack trace: Message:  Volo.Abp.Authorization.AbpAuthorizationException : Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.

Stack Trace:  FeatureCheckerExtensions.CheckEnabledAsync(IFeatureChecker featureChecker, Boolean requiresAll, String[] featureNames) MethodInvocationFeatureCheckerService.CheckAsync(MethodInvocationFeatureCheckerContext context) FeatureInterceptor.CheckFeaturesAsync(IAbpMethodInvocation invocation) FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) CastleAbpMethodInvocationAdapter.ProceedAsync() ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) CastleAbpMethodInvocationAdapter.ProceedAsync() UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed)

  • Steps to reproduce the issue:

Suppose we are trying to create a unit/integration test for a method in an application service layer equipped with a [RequiresFeature] attribute

[RequiresFeature(MyFeatures.MyAwesomeNewFeature)]
public virtual async Task< ItemsDto > GetListOfItemsAsync()
{
	return new ItemsDto
	{
		....
	};
}

Already in the ApplicationTestModule module with the AddAlwaysAllowAuthorization() extension all Permissions are being bypassed. But how can we bypass feature requirement for test purposes ?

public class IMyApplicationTestModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAlwaysAllowAuthorization();
        ....
    }
}

I tried to mock IFeatureChecker like in following example. But it broke all other unit test under MyAppService_Tests

    public class MyAppService_Tests : IMyApplicationTestBase
    {
        private readonly IMyAppService _iMyAppService;
        private readonly MyOptions _myOptions;
        private readonly ISettingProvider _settingProvider;

        private IFeatureChecker _featureChecker;

        public IMyAppService_Tests()
        {
            _iMyAppService = GetRequiredService< IMyAppService >();
            _myOptions = GetRequiredService< IOptions < MyOptions > >().Value;
            _settingProvider = GetRequiredService< ISettingProvider >();
        }

        protected override void AfterAddApplication(IServiceCollection services)
        {
            _featureChecker = Substitute.For< IFeatureChecker >();
            _featureChecker.IsEnabledAsync(MyFeatures.MyAwesomeNewFeature).Returns(Task.FromResult(true));
            services.AddSingleton(_featureChecker);
        }
        

        [Fact]
        public async Task GetListOfItems_Should_Return_IItemsDto()
        {
            // Arrange
            ....
            // Act
            var result = await _iMyAppService.GetListOfItemsAsync();

            // Assert
            result.ShouldNotBeNull();
        }}

This usage going to throw following exeception ex;

Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module MyCompany.MyTag.MyApp.IdentityTestBaseModule, MyCompany.MyTag.MyApp.TestBase, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null: The input string '' was not in a correct format.. See the inner exception for details.
---- System.FormatException : The input string '' was not in a correct format.

Hello, after updating the framework to 9.1.0 Unit tests are started to fail in our custom SaaS module due missing service registration.

Beside that how you guys managed to release commercial module with failing unit tests :)

Can you guys able to check and fix module accordingly ?

As a workaround; Base on error message, I temporarily added AbpSettingManagementEntityFrameworkCoreModule to the EntityFrameworkCore layer. This automatically registered missing services.

For the tests; I extended existing CreateDatabaseAndGetConnection() method with new SettingManagementDbContext

    private static SqliteConnection CreateDatabaseAndGetConnection()
    {
        var connection = new SqliteConnection("Data Source=:memory:");
        connection.Open();

        new SaasDbContext(
            new DbContextOptionsBuilder<SaasDbContext>().UseSqlite(connection).Options
        ).GetService<IRelationalDatabaseCreator>().CreateTables();

        new SettingManagementDbContext(
            new DbContextOptionsBuilder<SettingManagementDbContext>().UseSqlite(connection).Options
        ).GetService<IRelationalDatabaseCreator>().CreateTables();

        return connection;
    }

Check the docs before asking a question: https://docs.abp.io/en/abp/latest/API/API-Versioning https://docs.abp.io/en/abp/7.3/UI/AspNetCore/Data-Tables

Check the samples to see the basic tasks: https://github.com/abpframework/abp-samples/tree/master/Api-Versioning [This example doesn't show how to integrate api versiong with Datatables ]

  • ABP Framework version: v7.3.1
  • UI Type: MVC /
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): ye
  • Exception message and full stack trace:
  • Request did not specify a service API version, but multiple candidate actions were found. Candidate actions: Siemens.PSSX.Odms.Models.v130.ModelController.GetListAsync (Siemens.PSSX.Odms.HttpApi) Siemens.PSSX.Odms.Models.v131.ModelController.GetListAsync (Siemens.PSSX.Odms.HttpApi)

We have more than one version of one of our APIs. We can easily see the versions through the Swagger interface and working as intended.

JS proxy configuration from .Web project as shown below;


  (function(){

    abp.utils.createNamespace(window, 'siemens.pSSX.odms.models.v130.model');
    
    ... ///
    
    siemens.pSSX.odms.models.v130.model.getList = function(input, ajaxParams) {
      var api_version = api_version ? api_version : '13.0';
      return abp.ajax($.extend(true, {
        url: abp.appPath + 'api/odms/models' + abp.utils.buildQueryString([{ name: 'filterText', value: input.filterText }, { name: 'name', value: input.name }, { name: 'description', value: input.description }, { name: 'serverName', value: input.serverName }, { name: 'cIMVersion', value: input.cIMVersion }, { name: 'creatorId', value: input.creatorId }, { name: 'creationTimeMin', value: input.creationTimeMin }, { name: 'creationTimeMax', value: input.creationTimeMax }, { name: 'lastModifierId', value: input.lastModifierId }, { name: 'lastModificationTimeMin', value: input.lastModificationTimeMin }, { name: 'lastModificationTimeMax', value: input.lastModificationTimeMax }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }, { name: 'api-version', value: input.api_version }]) + '',
        type: 'GET'
      }, ajaxParams));
    };  
 })();
 
  (function(){

    abp.utils.createNamespace(window, 'siemens.pSSX.odms.models.v131.model');

    siemens.pSSX.odms.models.v131.model.getList = function(input, ajaxParams) {
      var api_version = api_version ? api_version : '13.1';
      return abp.ajax($.extend(true, {
        url: abp.appPath + 'api/odms/models' + abp.utils.buildQueryString([{ name: 'filterText', value: input.filterText }, { name: 'name', value: input.name }, { name: 'description', value: input.description }, { name: 'serverName', value: input.serverName }, { name: 'cIMVersion', value: input.cIMVersion }, { name: 'creatorId', value: input.creatorId }, { name: 'creationTimeMin', value: input.creationTimeMin }, { name: 'creationTimeMax', value: input.creationTimeMax }, { name: 'lastModifierId', value: input.lastModifierId }, { name: 'lastModificationTimeMin', value: input.lastModificationTimeMin }, { name: 'lastModificationTimeMax', value: input.lastModificationTimeMax }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }, { name: 'api-version', value: input.api_version }]) + '',
        type: 'GET'
      }, ajaxParams));
    };
 })();

For the sake of simplicity, two different MVC UI were designed for two different API versions.


var l = abp.localization.getResource("Odms");

var modelService = siemens.pSSX.odms.models.v130.model;

var getFilter = function () {
    return {
        filterText: $("#FilterText").val(),
        name: $("#NameFilter").val(),
        description: $("#DescriptionFilter").val(),
        serverName: $("#ServerNameFilter").val(),
        cIMVersion: $("#CIMVersionFilter").val(),
        creatorId: $("#ServerNameFilter").val(),
        creationTimeMin: $("#CreationTimeFilterMin").val(),
        creationTimeMax: $("#CreationTimeFilterMax").val(),
        lastModifierId: $("#ServerNameFilter").val(),
        lastModificationTimeMin: $("#LastModificationTimeFilterMin").val(),
        lastModificationTimeMax: $("#LastModificationTimeFilterMax").val(),
    };
};
    
 var dataTable = $("#ModelsTable").DataTable(abp.libs.datatables.normalizeConfiguration({
     processing: true,
     serverSide: true,
     paging: true,
     searching: false,
     scrollX: true,
     autoWidth: false,
     scrollCollapse: true,
     order: [[1, "asc"]],
     ajax: **abp.libs.datatables.createAjax(modelService.getList, getFilter),**
     columnDefs: [
         {
             ... ///
         }
      ]
    }));

abp.libs.datatables.createAjax(modelService.getList, getFilter),

How can we specify a service API version when creating ajax ?

Log: 2023-09-18 20:21:27.944 +02:00 [INF] Request did not specify a service API version, but multiple candidate actions were found. Candidate actions: Siemens.PSSX.Odms.Models.v130.ModelController.GetListAsync (Siemens.PSSX.Odms.HttpApi) Siemens.PSSX.Odms.Models.v131.ModelController.GetListAsync (Siemens.PSSX.Odms.HttpApi)

  • ABP Framework version: v7.3.2
  • UI Type: MVC
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
context.Services.AddAuthentication()
    //.AddAbpOpenIdConnect("myAuthSchema", "myAuth AD", options =>
    .AddOpenIdConnect("myAuthSchema", "myAuth AD", options =>
    {
        options.Authority = configuration["AzureAd:Authority"].EnsureEndsWith('/') + configuration["AzureAd:TenantId"].EnsureEndsWith('/') + "v2.0".TrimEnd('/');
        options.MetadataAddress = configuration["AzureAd:MetadataAddress"].EnsureEndsWith('/') + configuration["AzureAd:TenantId"].EnsureEndsWith('/') + "v2.0".EnsureEndsWith('/') + ".well-known/openid-configuration";
        options.ResponseType = OpenIdConnectResponseType.CodeIdToken;

        options.ClientId = configuration["AzureAd:ClientId"];
        options.ClientSecret = configuration["AzureAd:ClientSecret"];

        options.UsePkce = true;
        options.GetClaimsFromUserInfoEndpoint = true;

        options.TokenValidationParameters = new TokenValidationParameters()
        {
            ValidateIssuer = true,
        };

        options.TokenValidationParameters.ValidIssuers = new[]
        {
            configuration["AzureAd:MetadataAddress"],
            configuration["AzureAd:Authority"]
        };

        options.Scope.Add("openid");
        options.Scope.Add("profile");
        options.Scope.Add("offline_access");
        options.Scope.Add("email");
    });
    .WithDynamicOptions < OpenIdConnectOptions, OpenIdConnectHandler > (
        "myAuthSchema",
        options =>
        {
            options.WithProperty(x => x.ClientId);
            options.WithProperty(x => x.ClientSecret, isSecret: true);
        }
    );

I would like to provide ClientId and ClientSecret values via Account External Provider Settings

/api/account/external-provider endpoint keeps returning only Google, Twitter and Microsoft values

I also tried to extend provider list via AbpExternalProviderOptions but no luck

context.Services.Configure < AbpExternalProviderOptions > (options =>
{
    options.Definitions.Add(new ExternalProviderDefinition()
    {
        Name = "Test",
        Properties = new List < ExternalProviderDefinitionProperty >()
    });
});

What am i missing ?

  • ABP Framework version: v7.0.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

Hello, We can load module classes as plug-ins without adding reference to project. The relevant explanation is https://docs.abp.io/en/abp/latest/PlugIn-Modules located at here.

Where should we define MyPlugInDemoWebModule class in this example?

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity.PlugIns;

namespace MyPlugInDemo.Web
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddApplication<MyPlugInDemoWebModule>(options =>
            {
                options.PlugInSources.AddFolder(@"D:\Temp\MyPlugIns");
            });
        }

        public void Configure(IApplicationBuilder app)
        {
            app.InitializeApplication();
        }
    }
}

This sample code does not seem updated.

Can we replace ConfigureServices(IServiceCollection services) part with

public override void ConfigureServices(ServiceConfigurationContext context)
{

}

and Configure(IApplicationBuilder app) part with

public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
    var app = context.GetApplicationBuilder();
    
    app.InitializeApplication();    
}

More importantly, Can you share an example where we consume a service in a project that we did add as reference

For example, I want to call MyService : IMyService, ITransientDependency that we created in the plug-in

  • ABP Framework version: v7.0.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Steps to reproduce the issue:"
  • Create module from the template
  • For the sake of example modify menu item
    private static ApplicationMenuItem AddModuleMenuItem(MenuConfigurationContext context)
    {
        var l = context.GetLocalizer<TestModuleResource>();

        var moduleMenu = new ApplicationMenuItem(
            TestModuleMenus.Prefix,
            displayName: l["Menu:TestModule"],
            "~/TestModule",
            icon: "fa fa-globe");

        //Add main menu items.
        context.Menu.Items.AddIfNotContains(moduleMenu);
        return moduleMenu;
    }
  • Check localization json file if there is an entry under Domain.Shared layer
  • Launch application

I believe that it is related with virtual file configuration of the Web.Host template File path needs to be Domain.Shared not Domain

  • ABP Framework version: v7.0.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: *Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'Volo.Abp.Account.IAccountSettingsAppService' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency. at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.Account.Admin.Web.Settings.AccountSettingManagementPageContributor.ConfigureAsync(SettingPageCreationContext context) at Volo.Abp.SettingManagement.Web.Pages.SettingManagement.SettingPageContributorManager.ConfigureAsync() at Volo.Abp.SettingManagement.Web.Pages.SettingManagement.IndexModel.OnGetAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
  • Steps to reproduce the issue:
  • Create a new module from template
  • Login with admin user
  • Hit the settings

Most possible it is due to missing Volo.Abp.Account.Pro.Admin.HttpApi.Client package at .Web.Host template

  • ABP Framework version: v7.0.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Steps to reproduce the issue:"
  • Create a new module from template
  • Disable redis by updating appsettings.json
  • Use Web.Host for ui
  • Wait 30 min Menu items are going to disappear, most possible due to expired token.

Is it related with https://support.abp.io/QA/Questions/4677/User-lost-credentials-after-30min-without-activity or https://github.com/abpframework/abp/issues/14068

Showing 1 to 10 of 24 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 08, 2025, 08:24
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.