I have a asp.net core project with angular template with below files structure.
I want to read the static HTML file (EmailConfirmation.html) from Template folder.
My code to read this file inside a controller as below.
string body = string.Empty;
using (StreamReader reader = new StreamReader("./Template/EmailConfirmation.html"))
{
body = reader.ReadToEnd();
}
But when I publish this app to azure, There is no folder created with the name Template inside wwwroot folder. Thus caught with an error
Something went wrong: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\Template\EmailConfirmation.html'
For your note : I have tried with steps mentioned in the below article
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-2.2
But not worked out !
How can I solve this problem. Thanks for your attention. Iām looking forward to your reply.