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
  • 8,988
  • 2
  • 25
  • 49
yaghob abbasi
  • 46
  • 1
  • 9

0 Answers0