You need to "close" .net Configuration

When you create a configuration object for managing .net configuration files, you need to close the files.

I have an application with several .dll components. Should I use global configuration to avoid writing changes made by other .dlls to the same configuration file.

Public Shared config As System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) ....do config entries here. config.save 

I know that you need to close / delete this configuration before making changes to the same configuration file from another module.

+4
source share
1 answer

No, you do not need to close / delete. The Configuration class returned by the OpenExeConfiguration static method does not implement IDisposable , and has no Close method, so your code is fine.

+5
source

All Articles