Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
186 views
in Technique[技术] by (71.8m points)

c# - Getting server error after deploying the changes to hosting space

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...