I have an ASP.NET MVC project that has a subfolder named email. It contains htm files for my email templates. At certain points on the site, I have a controller that needs to download one of these templates and send it as email.
What I'm trying to do is use reflection to get the path to the current executing assembly, but it does not work as I would expect. The path I return is as follows:
var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
"C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET iles \ ssl \ 1da130c4 \ f8e7810e \ assembly \ dl3 \ 5f253aca \ 1a71f123_e83bcc01 \ Email \ ProductAccountConfirmation.htm '
I find this strange because the site is hosted in IIS through Visual Studio. I would think that this would give me the dll location in my project folder in dev and the deployment folder for IIS during production.
source share