Scenario. I need to access an HTML template to create email from my business logic level. This class library contains a subfolder containing the file. When I tried the following code in unit test:
string FilePath = string.Format(@"{0}\templates\MyFile.htm", Environment.CurrentDirectory);
string FilePath1 = string.Format(@"{0}\templates\MyFile.htm", System.AppDomain.CurrentDomain.BaseDirectory);
He used the C: \ WINNT \ system32 \ directory or the ASP.NET Temporary Folder directory.
What is the best way to access this file without using the app.config or web.config file?
[This is using the WCF service]
source
share