Open Closed

Issue in production but working in debug mode Could not find a file/folder at the location: /Emailing/Templates/EmailTemplate.tpl #1862


User avatar
0
Anjaneyulu created
  • ABP Framework version: v4.4.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: Volo.Abp.AbpException: Could not find a file/folder at the location: /Emailing/Templates/EmailTemplate.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.TextTemplateManagement.TextTemplates.TemplateContentAppService.GetAsync(GetTemplateContentInput input) in D:\Sandbox\FAB_AMS_Latest_Version\modules\Volo.TextTemplateManagement\src\Volo.Abp.TextTemplateManagement.Application\Volo\Abp\TextTemplateManagement\TextTemplates\TemplateContentAppService.cs:line 36 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
  • Steps to reproduce the issue:"
    1. Created a Text template as follows for custome code emailing.
  1. Added following code In
    1. ApplicationContractModule.cs public override void ConfigureServices(ServiceConfigurationContext context) { Configure
    2. public class DeviceEmailTemplateDefinitionProvider : TemplateDefinitionProvider { public override void Define(ITemplateDefinitionContext context) { var emailLayoutTemplate = context.GetOrNull(StandardEmailTemplates.Layout); emailLayoutTemplate .WithVirtualFilePath( "/Emailing/Templates/EmailTemplate.tpl", isInlineLocalized: true ); context.Add(emailLayoutTemplate); context.Add( new TemplateDefinition( DeviceEmailTemplates.ReSendOTP, displayName: LocalizableString.Create
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the csproj(ApplicationContractModule) file?

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

    hi

    Can you share the csproj(ApplicationContractModule) file?

    <Project Sdk="Microsoft.NET.Sdk">
    
      <Import Project="..\..\common.props" />
    
      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <RootNamespace>Test</RootNamespace>
      </PropertyGroup>
    
    
    
      <ItemGroup>
        <ProjectReference Include="..\Test.Domain.Shared\Test.Domain.Shared.csproj" />
      </ItemGroup>
    
      <ItemGroup>
        <ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Shared.Application.Contracts\Volo.Abp.Account.Pro.Shared.Application.Contracts.csproj" />
        <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.4.2" />
        <PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.4.2" />
        <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.4.2" />
        <PackageReference Include="Volo.Saas.Host.Application.Contracts" Version="4.4.2" />
        <PackageReference Include="Volo.Abp.AuditLogging.Application.Contracts" Version="4.4.2" />
        <ProjectReference Include="..\..\modules\Volo.Identity.Pro\src\Volo.Abp.Identity.Pro.Application.Contracts\Volo.Abp.Identity.Pro.Application.Contracts.csproj" />
        <PackageReference Include="Volo.Abp.IdentityServer.Application.Contracts" Version="4.4.2" />
        <ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Application.Contracts\Volo.Abp.Account.Pro.Public.Application.Contracts.csproj" />
        <ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Admin.Application.Contracts\Volo.Abp.Account.Pro.Admin.Application.Contracts.csproj" />
        <PackageReference Include="Volo.Abp.LanguageManagement.Application.Contracts" Version="4.4.2" />
        <ProjectReference Include="..\..\modules\Volo.TextTemplateManagement\src\Volo.Abp.TextTemplateManagement.Application.Contracts\Volo.Abp.TextTemplateManagement.Application.Contracts.csproj" />
        <ProjectReference Include="..\..\modules\Volo.LeptonTheme\src\Volo.Abp.LeptonTheme.Management.Application.Contracts\Volo.Abp.LeptonTheme.Management.Application.Contracts.csproj" />
      </ItemGroup>
    
      <ItemGroup>
        <EmbeddedResource Include="Emailing\Templates\Templates\*.tpl" />
        <None Remove="Emailing\Templates\Templates\*.tpl" />
      </ItemGroup>
      
    </Project>
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Is Emailing\Templates\Templates\*.tpl path correct?

    Maybe Emailing\Templates\*.tpl

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

    hi

    Is Emailing\Templates\Templates\*.tpl path correct?

    Maybe Emailing\Templates\*.tpl

    I have updated the path. Also, tried setting build actions to copy always for embedded resources. But im getting the same issue.

    <Project Sdk="Microsoft.NET.Sdk">

    <Import Project="....\common.props" />

    <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <RootNamespace>Test</RootNamespace> </PropertyGroup>

    <ItemGroup> <ProjectReference Include="..\Test.Domain.Shared\Test.Domain.Shared.csproj" /> </ItemGroup>

    <ItemGroup> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Shared.Application.Contracts\Volo.Abp.Account.Pro.Shared.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Saas.Host.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.AuditLogging.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.Identity.Pro\src\Volo.Abp.Identity.Pro.Application.Contracts\Volo.Abp.Identity.Pro.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.IdentityServer.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Application.Contracts\Volo.Abp.Account.Pro.Public.Application.Contracts.csproj" /> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Admin.Application.Contracts\Volo.Abp.Account.Pro.Admin.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.LanguageManagement.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.TextTemplateManagement\src\Volo.Abp.TextTemplateManagement.Application.Contracts\Volo.Abp.TextTemplateManagement.Application.Contracts.csproj" /> <ProjectReference Include="....\modules\Volo.LeptonTheme\src\Volo.Abp.LeptonTheme.Management.Application.Contracts\Volo.Abp.LeptonTheme.Management.Application.Contracts.csproj" /> </ItemGroup>

    <ItemGroup> <EmbeddedResource Include="Emailing\Templates*.tpl" /> <None Remove="Emailing\Templates*.tpl" /> </ItemGroup>

    </Project>

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

    hi

    Did you add it to AbpVirtualFileSystemOptions?

    
    Configure<AbpVirtualFileSystemOptions>(options =>
    {
        options.FileSets.AddEmbedded<AbpYourContractsModule>();
    });
    

    https://docs.abp.io/en/abp/latest/Text-Templating-Scriban#the-template-content

    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.