Click here to Skip to main content
15,920,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello i have develop a setup installer using VS installer. i want to retrieve the executable directory path in app.config.

Suppose

my application is running in C:\program files\myApplication\myapplication.exe

now i want to find the executable path like c:\Program files\Myapplication

What I have tried:

here with the help of c# code i can retrieve the path but how can i get it in app.config
Posted
Updated 13-Jul-17 3:40am

1 solution

e.g.
using System.IO;
using System.Reflection;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
        }
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900