Hello everyone,
I m trying to use the ConfigurationMa nager class to store and retrieve
configuration data for my application.
My piece of code can create, write and read data from the file but when my
application close, the configuration file disappear.
In fact, when I use the "debug" to launch and test my application the
app.exe.config is created and when the application finish, the file is
deleted.
When I try to generate the application, the app.exe.config isn't created too.
How can I do to create this file and to keep it not deleted?
Here what I m using:
Public Shared Sub Write(ByVal entry As String, ByVal value As String)
Try
Dim Config As Configuration =
ConfigurationMa nager.OpenExeCo nfiguration(Con figurationUserL evel.None)
Config.AppSetti ngs.Settings.Ad d(entry, value)
Config.AppSetti ngs.Settings.It em(entry).Value = value
Config.Save(Con figurationSaveM ode.Modified)
ConfigurationMa nager.RefreshSe ction("appSetti ngs")
Catch ex As Exception
MsgBox(ex.ToStr ing())
End Try
End Sub
Thanks a lot or your answers.
I m trying to use the ConfigurationMa nager class to store and retrieve
configuration data for my application.
My piece of code can create, write and read data from the file but when my
application close, the configuration file disappear.
In fact, when I use the "debug" to launch and test my application the
app.exe.config is created and when the application finish, the file is
deleted.
When I try to generate the application, the app.exe.config isn't created too.
How can I do to create this file and to keep it not deleted?
Here what I m using:
Public Shared Sub Write(ByVal entry As String, ByVal value As String)
Try
Dim Config As Configuration =
ConfigurationMa nager.OpenExeCo nfiguration(Con figurationUserL evel.None)
Config.AppSetti ngs.Settings.Ad d(entry, value)
Config.AppSetti ngs.Settings.It em(entry).Value = value
Config.Save(Con figurationSaveM ode.Modified)
ConfigurationMa nager.RefreshSe ction("appSetti ngs")
Catch ex As Exception
MsgBox(ex.ToStr ing())
End Try
End Sub
Thanks a lot or your answers.
Comment