I tried to determine current running directory of my C# console application using the following code:
However that code returns path to assembly location. It may be different from the folder where EXE file is located.
My console application parses logs with no parameters. I want to know the path to the
logs/ folder inside of the current executable's folder. Please help!
In the ASP.NET. Have you ever wanted to get the directory for the executing Console Application in C#? The following method will do so, and is the equivalent of Application.StartupPath when working with Windows Forms.
You can use following method:
you can use "Directory.GetCurrentDirectory" to get the current working directory of the application.