0

I have a problem when I'll get file path onto class library project. I have a log4net.config file into my class library project and I need get and read log4net.config. I test many solution:

1

var buildDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 
var filePath = buildDir + @"\log4net.config";

2

var dirPath = Assembly.GetExecutingAssembly().Location;
dirPath = Path.GetDirectoryName(dirPath);
return Path.GetFullPath(Path.Combine(dirPath, "\log4net.config"));

but I don't get any result. please suggest a solution.

McNets
  • 10,352
  • 3
  • 32
  • 61
yaghob abbasi
  • 96
  • 1
  • 12

0 Answers0