Hi all,
i have app.windows .NET that open an app.config from a Windows service for
modify values. The app.config of service uses EntLibrary Exceptionhandling
and Logging.
My code for modify app.config of service using my WinForms App:
Dim rutaConfig As String = Me.tbRutaConfigServicioBase.Text
'// Map to the application configuration file.
Dim configFile As ExeConfigurationFileMap = New ExeConfigurationFileMap()
configFile.ExeConfigFilename = rutaConfig
Dim config As Configuration =
ConfigurationManager.OpenMappedExeConfiguration(co nfigFile,
ConfigurationUserLevel.None)
Dim keys As String() = config.AppSettings.Settings.AllKeys
' Get the KeyValueConfigurationCollection
' from the configuration.
Dim settings1 As KeyValueConfigurationCollection = _
config.AppSettings.Settings()
settings1("GRUPOBACKUP.Ruta_Grabar_Ficheros").Valu e =
Me.tbGRUPOBACKUP_Ruta_Grabar_Ficheros.Text
settings1("SERVIDOR_INDEXADO").Value = Me.tbSERVIDOR_INDEXADO.Text
settings1("PDF_CREADOR").Value = Me.tbPDF_CREADOR.Text
settings1("PDF_AUTOR").Value = Me.tbPDF_AUTOR.Text
settings1("PDF_TITULO").Value = Me.tbPDF_TITULO.Text
settings1("PDF_ASUNTO").Value = Me.tbPDF_ASUNTO.Text
config.Save(ConfigurationSaveMode.Modified, True)
I get this error:
'System.Configuration.ConfigurationErrorsException was unhandled
' BareMessage = "Se ha producido un error al crear el controlador de
sección de configuración para exceptionHandling: No se puede cargar el
archivo o ensamblado
'Microsoft.Practices.EnterpriseLibrary.ExceptionHa ndling, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null' ni una de sus dependencias. El sistema
no puede hallar el archivo especificado."
' Filename = "C:\Archivos de programa\GRUPO BACKUP\GRUPO BACKUP
Servicios Principales OGF\ServicioBase.exe.config"
'StackTrace:
Not load assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHa ndling
Config.Save loads assemblies that appears in app.config ???
Any suggestions???
Thanks in advance
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.com/churrosoft
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft