When ever you are using Environment.CurrentDirectory you must be cautious because it has an advantage of changing the CurrentDirectory path at anytime in your code it has major disadvantage of changing its path when ever your are using the controls like FileDialogs.
So how can i replace the Environment.CurrentDirectory place? With Whom i can replace the Environment.CurrentDirectory place?
Here we have the solution with AppDomain.CurrentDomain.BaseDirectory. AppDomain.CurrentDomain.BaseDirectory is read-only since you can’t change it after the appdomain has been created.