VB.NET how to move app.config files to a custom location

I have an application that has a bunch of values ​​in its app.exe.config file. The application is used by a small number of users and the settings will be changed periodically. So I have to change the configuration file and Send it to all users.

I like to move the configuration file somewhere on the network and point the application to this file. I’ve tried to use it

p>

Imports System.Configuration.ConfigurationManager

OpenExeConfiguration("I:\app config\HelpDeskQuickCallLogger.exe.config")

But I can’t make it read values.

Any ideas?

If a specific configuration file (sSpecificConfigurationFile) is specified, this is how we handle this request:

Dim oConfig As System.Configuration.Configuration

If sSpecificConfigurationFile.EndsWith(".config", StringComparison.InvariantCultureIgnoreCase) Then
Dim oMap As New ExeConfigurationFileMap
oMap.ExeConfigFilename = sSpecificConfigurationFile
oConfig = ConfigurationManager.OpenMappedExeConfiguration(oMap, ConfigurationUserLevel.None)
Else
oConfig = ConfigurationManager.OpenExeConfiguration(sSpecificConfigurationFile)< br /> End If

I have an application that has a bunch of values ​​in its app.exe.config file. The application is used by a small number of users and the settings will be changed regularly .So I have to change the configuration file and send it to all users.

I like to move the configuration file somewhere on the network and point the application to this file. I’ve tried to use

Imports System.Configuration.ConfigurationManager

OpenExeConfiguration("I:\app config\HelpDeskQuickCallLogger.exe.config")

But I can’t make it read the values.

Any ideas?

If a specific configuration file (sSpecificConfigurationFile) is specified, this is how we handle this request:

Dim oConfig As System.Configuration.Configuration

If sSpecificConfigurationFile.EndsWith(".config", StringComparison.InvariantCultureIgnoreCase) Then
Dim oMap As New ExeConfigurationFileMap
oMap .ExeConfigFilename = sSpecificConfigurationFile
oConfig = ConfigurationManager.OpenMappedExeConfiguration(oMap, ConfigurationUserLevel.None)
Else
oConfig = ConfigurationManager.OpenExeConfiguration(sSpecificConfigurationFile)
End If

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3414 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.