get application path csharp

Code Example - get application path csharp

                
                        System.Reflection.Assembly.GetExecutingAssembly().Location
                    
                
 

csharp app path

                        
                                string appPath = AppDomain.CurrentDomain.BaseDirectory;
                            
                        
 

csharp windows application get current path

                        
                                System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                            
                        
 

csharp get application root path directory

                        
                                public static string GetApplicationRoot()
        {
            var exePath = new Uri(System.Reflection.
            Assembly.GetExecutingAssembly().CodeBase).LocalPath;
            return new FileInfo(exePath).DirectoryName;

        }