#Get current Assembly information through Reflection.
protected static string GetCurrentFolder()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);
}
var file = File.ReadAllText(Path.Combine(GetCurrentFolder(), @"Documents\Template.html"));
#Without Reflection you can use the below command,but make sure you copy the file in bin -> debug folder Set the property of file Copy to Output Directory as "Copy Always" from visual studio.(Create a folder for your document as paste the file in visual studio)
File.OpenRead(Path.Combine(
AppDomain.CurrentDomain.BaseDirectory, @"Documents\Template.html"));