I was working in a Web api project to send mail after user registration.
In my startup.cs i have
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new
PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"Templates")),
RequestPath = new PathString("/Templates")
});
In templates i have one html file which contains a mail body, in my controller i have something like this
using (StreamReader reader = new StreamReader(Path.Combine("Pages", "EmailTemplate.html")))
{
body = reader.ReadToEnd();
}
Which is working perfectly in my local machine and its NOT working after deploying it to my hosting space. I am working with go daddy which supports only upto 2.0. and my project also built up on 2.0. But in local its working fine.
Any idea why its not working after deployment?
Any other alternatives i can use to read my html template from hosting environment?
question from:
https://stackoverflow.com/questions/65886509/getting-server-error-after-deploying-the-changes-to-hosting-space 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…