I have a wcf service that is responsible for sending emails with a template html
as a base, which I try to read as shown below, so far I can not read it. My service is hosted on IIS 7.5
What I am trying to do is the following:
string path = System.Web.Hosting.HostingEnvironment.MapPath("~/bin/Template/file.html");
text = File.ReadAllText(@path);
But path
it stays likenull
How could I access that file html
?
In another attempt I tried to use the following but with the same result:
path = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
to retrieve the folder where your service is running you should use reflection like this