Bjr,
est il possible de charger l'app.config depuis une DLL ou un service?? comme depuis un programme...
si oui comment ?
merci
Bjr,
est il possible de charger l'app.config depuis une DLL ou un service?? comme depuis un programme...
si oui comment ?
merci
j'ai exactement le meme souci que lui:
http://www.developpez.net/forums/d50...der-ne-marche/
au passage "neptune" n'a pas bien pigé que le phénomène se passe lorsque c est une DLL qui cherche son app.config.... lui donne l'exemple d'un executable... et forcement la ca marche bien..
moi aussi je recois les valeur par defaut...
hum...
http://bytes.com/forum/thread276419.html
Hi Alan,
We can not apply an app.config file to the class library dll. Because just
as the name implied, this configuration file is for the application wide.
I think what "Nicholas Paldino [.NET/C# MVP]" sugggested is to place the
class library configuration sections into the app.config file where your
application is in. Then your class library code can read the configuration
without any problem.
If you still want a customized config file for class library so that we
need not copy the config information to all the applications using the dll,
I think we have to store the configuration information in a XML file, then
use System.Xml namespace classes to read this XML config file.
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Et en faisant :
?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Configuration cm = ConfigurationManager.OpenExeConfiguration("MaDll.dll.config");
dev01
je crois que ca marche pas non plus, mais j'ai pas vérifier ( à l occazz je le dirais)
par contre la je passe par un service (avec un exe) et ca marche !
c est deja ca
merci pour ta réponse !
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager