K
kramii
Apparently, if I open a named file using OpenExeConfiguration, modify
it and try to save the file using Configuration.Save, the framework
appends ".config" onto the fileaname. Is this a bug?
Here is part of my test class. There is already a file in my
application's bin directory called BBB.XML. A new file is created
called BBB.XML.config.
Public Shared Function Load() As FtpConfiguration
If IsNothing(_instance) Then
_configFile =
ConfigurationManager.OpenExeConfiguration("BBB.XML")
If IsNothing(_configFile.GetSection("MyNewSection")) Then
_instance = New FtpConfiguration
_configFile.Sections.Remove("MyNewSection")
_configFile.Sections.Add("MyNewSection", _instance)
_instance.FtpServer = "SERVERNAME"
_instance.SectionInformation.ForceSave = True
_configFile.Save() 'As("BBB.XML",
ConfigurationSaveMode.Minimal, True)
Debug.WriteLine("Configuration created in: " &
_configFile.FilePath)
Else
_instance =
CType(_configFile.GetSection("MyNewSection"), FtpConfiguration)
End If
End If
Return _instance
End Function
it and try to save the file using Configuration.Save, the framework
appends ".config" onto the fileaname. Is this a bug?
Here is part of my test class. There is already a file in my
application's bin directory called BBB.XML. A new file is created
called BBB.XML.config.
Public Shared Function Load() As FtpConfiguration
If IsNothing(_instance) Then
_configFile =
ConfigurationManager.OpenExeConfiguration("BBB.XML")
If IsNothing(_configFile.GetSection("MyNewSection")) Then
_instance = New FtpConfiguration
_configFile.Sections.Remove("MyNewSection")
_configFile.Sections.Add("MyNewSection", _instance)
_instance.FtpServer = "SERVERNAME"
_instance.SectionInformation.ForceSave = True
_configFile.Save() 'As("BBB.XML",
ConfigurationSaveMode.Minimal, True)
Debug.WriteLine("Configuration created in: " &
_configFile.FilePath)
Else
_instance =
CType(_configFile.GetSection("MyNewSection"), FtpConfiguration)
End If
End If
Return _instance
End Function