user control + app.config
-
Hi, i've created a user control and it must read an app.config, but it doesn't work. The user control can'f find the app.config file. how I do to user control find thee app.config file? thank you.
-
Hi, i've created a user control and it must read an app.config, but it doesn't work. The user control can'f find the app.config file. how I do to user control find thee app.config file? thank you.
Controls and .DLL's don't get their own configuration files. As the name suggests, they're Application configuration files, not component. You're control will have to rely on the developer supplying the configuration in his/her application's app.config file if you want to use the .NET Frameworks built-in classes and methods for retrieving config options. The only way to supply a seperate config file for your component (not a good idea BTW!), is to implement your own config file (preferrably in XML,) specifying your own schema and writing the code to find and load the config file yourself.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Controls and .DLL's don't get their own configuration files. As the name suggests, they're Application configuration files, not component. You're control will have to rely on the developer supplying the configuration in his/her application's app.config file if you want to use the .NET Frameworks built-in classes and methods for retrieving config options. The only way to supply a seperate config file for your component (not a good idea BTW!), is to implement your own config file (preferrably in XML,) specifying your own schema and writing the code to find and load the config file yourself.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007is it possible the dll read the app.config file of the application?