Studies show that good grammar leads to more promotions and higher salaries. Write with Grammarly

C# Tips and Tricks #6 – Find the Application Path in Console Application

There are times when you are working on a console application in C# and you might want to get the application path. You might notice that the Application.StartupPath would not be available in console application which exists in the Winforms.

How to get Application Path in a Console Application in C#?

You can use the reflection to get it easily using the property


Here’s a sample code demonstrating how to get the application path in console application in C#.

using System;
namespace ConsoleApp1
    class Program
        static void Main(string[] args)

            string path = System.Reflection.Assembly.GetExecutingAssembly().Location;