I am calling a helper method in my Services class library project from a controller in my UI web application. I cannot get the proper path to the templates in the services project. I have tried dozens of ways but every time the base path of the full path points to the UI project.
C:\Users\TFD\OneDrive\TestEmal.UI\TestEmal.UI\bin\Debug\netcoreapp2.0\EmailService\EmailTemplates\EmailMaster_Body.html
I am building the path in the Services class library project
private static readonly string ThisDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
This came from the accepted solution from this post, accepted answer by mark Amery
I have tried every permutation of Path and of Assembly but every one returns the path to the Web UI application.
How do I get the base path of the Services class library project without hardcoding or using Replace?