Ends in:
2 DAYS
1 HR
49 MIN
2 SEC
Ends in:
2 D
1 H
49 M
2 S
Open Closed

Virtual File System not working in Azure #3054


User avatar
0
balessi75 created

Abp Commercial 5.2.0 / Blazor Server / EF / Non-tiered

Hi, we are receiving the below exception when using the virtual file system to override the default email confirmation text template. Everything works fine when running locally in VS, but the exception:

Volo.Abp.AbpException: Could not find a file/folder at the location: /Email/Templates/EmailConfirmation.tpl

occurs when running in azure. We noticed that this has been encountered before in the following post, but nothing posted there seems to work in our situation. https://support.abp.io/QA/Questions/2187/TemplateDefinitionProvider-ABP---Virtual-File-Path-not-working-after-deployment-to-Azure

We've looked at https://support.abp.io/QA/Questions/2187/TemplateDefinitionProvider-ABP---Virtual-File-Path-not-working-after-deployment-to-Azure Our .tpl files are flagged as an 'Embedded Resource' in our Application.Contracts Project and we have the following defined in the ConfigureServices method of the Application.Contracts project:

  Configure<AbpVirtualFileSystemOptions>(options =>
        {
            options.FileSets.AddEmbedded<TimepieceApplicationContractsModule>();
        });
2022-05-10 22:31:02.338 +00:00 [INF] Executed endpoint '/Account/Login'
2022-05-10 22:31:02.357 +00:00 [ERR] An unhandled exception has occurred while executing the request.
Volo.Abp.AbpException: Could not find a file/folder at the location: /Email/Templates/EmailConfirmation.tpl
   at Volo.Abp.TextTemplating.VirtualFiles.LocalizedTemplateContentReaderFactory.CreateInternalAsync(TemplateDefinition templateDefinition)
   at Volo.Abp.TextTemplating.VirtualFiles.LocalizedTemplateContentReaderFactory.CreateAsync(TemplateDefinition templateDefinition)
   at Volo.Abp.TextTemplating.VirtualFiles.VirtualFileTemplateContentContributor.GetOrNullAsync(TemplateContentContributorContext context)
   at Volo.Abp.TextTemplating.TemplateContentProvider.GetContentOrNullAsync(ITemplateContentContributor[] contributors, TemplateContentContributorContext context)
   at Volo.Abp.TextTemplating.TemplateContentProvider.GetContentOrNullAsync(TemplateDefinition templateDefinition, String cultureName, Boolean tryDefaults, Boolean useCurrentCultureIfCultureNameIsNull)
   at Volo.Abp.TextTemplating.TemplateRenderingEngineBase.GetContentOrNullAsync(TemplateDefinition templateDefinition)
   at Volo.Abp.TextTemplating.Scriban.ScribanTemplateRenderingEngine.RenderSingleTemplateAsync(TemplateDefinition templateDefinition, Dictionary`2 globalContext, Object model)
   at Volo.Abp.TextTemplating.Scriban.ScribanTemplateRenderingEngine.RenderInternalAsync(String templateName, Dictionary`2 globalContext, Object model)
   at Volo.Abp.TextTemplating.Scriban.ScribanTemplateRenderingEngine.RenderAsync(String templateName, Object model, String cultureName, Dictionary`2 globalContext)
   at Volo.Abp.TextTemplating.AbpTemplateRenderer.RenderAsync(String templateName, Object model, String cultureName, Dictionary`2 globalContext)
   at Volo.Abp.Account.Emailing.AccountEmailer.SendEmailConfirmationLinkAsync(IdentityUser user, String confirmationToken, String appName, String returnUrl, String returnUrlHash)
   at Volo.Abp.Account.AccountAppService.SendEmailConfirmationTokenAsync(IdentityUser user, String applicationName, String returnUrl, String returnUrlHash)
   at Volo.Abp.Account.AccountAppService.SendEmailConfirmationTokenAsync(SendEmailConfirmationTokenDto input)

Thanks in advance.


1 Answer(s)
  • User Avatar
    0
    balessi75 created

    I needed to pass the root namespace name to options.FileSets.AddEmbedded...

    options.FileSets.AddEmbedded<TimepieceApplicationContractsModule>("FM.Timepiece")

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35