Base solution for your next web application
Open Closed

InstallAppService #10818

BobIngham created

.Net Core, Angular, 11.0.0

I have a cuople of question install


Can anyone tell where the InstallAppService is invoked and why? I have searched the code and found the module and component in angular and invoked the route using localhost:4200/app/admin/install and the page flickers on screen before rerouting. What I was trying to do was to set development smtp settings during start up for a fresh project. I can see the following settings in the .NET Core project, src\Nuage.Application\Install\InstallAppService.cs:

private async Task SetSmtpSettings(EmailSettingsEditDto input)
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.DefaultFromAddress, input.DefaultFromAddress);
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.DefaultFromDisplayName, input.DefaultFromDisplayName);
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.Host, input.SmtpHost);
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.Port, input.SmtpPort.ToString(CultureInfo.InvariantCulture));
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.UserName, input.SmtpUserName);
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.Password, SimpleStringCipher.Instance.Encrypt(input.SmtpPassword));
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.Domain, input.SmtpDomain);
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.EnableSsl, input.SmtpEnableSsl.ToString().ToLowerInvariant());
    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.UseDefaultCredentials, input.SmtpUseDefaultCredentials.ToString().ToLowerInvariant());

And thought that would be where I put my initialisation code. Am I missing something? Any pointers most welcome.


It seems to me that DemoMode is difficult to find and incomplete. At line 33 of src\Nuage.Core\MultiTenancy\Demo\ TenantDemoDataBuilder.cs we have:

return string.Equals(_appConfiguration["App:DemoMode"], "true", StringComparison.OrdinalIgnoreCase);

Should we not also add the following to appsettings and document same?

2 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @bobingham

    InstallAppService ins invoked when the app doesn't have a database when its first run. In that case, user will be prompted with an install screen.

    DemoMode is develop for our internal usage but if you think it would be useful for everyone, we can document it.

  • 0
    BobIngham created

    Thanks @ismcagdas, now I understand.