Open Closed

Settings management ui and tenant specific settings #1797


User avatar
0
LW created
  • ABP Framework version: 4.4.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

I Have two questions:

  1. I Created a background process console application to handle longer, scheduled calculations. In that application I defined calculation scheduling settings provider:
	public class TenantCalculationTimeSettingProvider : SettingDefinitionProvider
	{
		public override void Define(ISettingDefinitionContext context)
		{
			context.Add(
				new SettingDefinition("CalculationTimeCronConf"
				, "0 */1 * ? * *"
				, new LocalizableString(typeof(TenantCalculationTimeSettingProvider), "configuration for time scheduled calculation")
				,new LocalizableString(typeof(TenantCalculationTimeSettingProvider), "configuration for time scheduled calculation")
			));
		}
	}

I cannot get the Define-method to fire no matter what I try. I have added the dependency to AbpSettingsModule and tried to register the provider manually



   public override void ConfigureServices(ServiceConfigurationContext context)
		{
			Configure<AbpSettingOptions>(options =>
			{
				options.DefinitionProviders.Add<TenantCalculationTimeSettingProvider>();
			});
		}

If I add the same provider in my main web application it works. I'm I missing some dependency in my new application for the Define to work?

2 If I define the setting this way, is there an Angular component (In commersial package perhaps) that enables viewing and editing this setting?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Can you share a project to reproduce?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    LW created

    Not publicly unless I do a new similar but generic project.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can create a minimal project to reproduce it

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    LW created

    OK, I have done that. How can I share this with you?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Please send it to my email : shiwei.liang@volosoft.com thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Setting definitions is lazy load, It will be loaded the first time you use it.

    try:

    public class BackgroundProcessManagerHostedService : IHostedService
    {
        private readonly IAbpApplicationWithExternalServiceProvider _application;
        private readonly IServiceProvider _serviceProvider;
        private readonly HelloWorldService _helloWorldService;
        private readonly ISettingProvider _settingProvider;
    
        public BackgroundProcessManagerHostedService(
            IAbpApplicationWithExternalServiceProvider application,
            IServiceProvider serviceProvider,
            HelloWorldService helloWorldService, ISettingProvider settingProvider)
        {
            _application = application;
            _serviceProvider = serviceProvider;
            _helloWorldService = helloWorldService;
            _settingProvider = settingProvider;
        }
    
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            await _settingProvider.GetAllAsync();
            _application.Initialize(_serviceProvider);
    
            _helloWorldService.SayHello();
        }
    
        public Task StopAsync(CancellationToken cancellationToken)
        {
            _application.Shutdown();
    
            return Task.CompletedTask;
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.