In some cases _hostingEnvironment.ContentRootPath
and System.IO.Directory.GetCurrentDirectory()
targets to source directory. Here is bug about it.
The solution proposed there helped me
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);