A
Alberto
In a class called "Config.cs" I have declared a field like this:
private string path = Path.GetDirectoryName(Application.ExecutablePath);
This class is initialized in the constructor of a UserControl (Config config
= new Config()).
When I execute the application everything is fine but if I try to add the
UserControl to a form, an error message says "access deny to "C:\Program
files\Microsoft Visual Studio 9.0\Common7\IDE\MyConfig.xml". So, as you see,
when I run the app, Application.ExecutablePath returns the right executable
path but when I'm building the forms in design time, returns a wrong
directoty.
private string path = Path.GetDirectoryName(Application.ExecutablePath);
This class is initialized in the constructor of a UserControl (Config config
= new Config()).
When I execute the application everything is fine but if I try to add the
UserControl to a form, an error message says "access deny to "C:\Program
files\Microsoft Visual Studio 9.0\Common7\IDE\MyConfig.xml". So, as you see,
when I run the app, Application.ExecutablePath returns the right executable
path but when I'm building the forms in design time, returns a wrong
directoty.