VB.Net How to move app.config file to user location

I have an application that has loading values ​​in the app.exe.config file. The application is used by several users, and the settings will change on a regular basis. therefore, they need to modify the configuration file and send it to all users.

I would like to move the configuration file to the network somewhere and point the application to this file. ive tried to use;

Imports System.Configuration.ConfigurationManager OpenExeConfiguration("I:\app config\HelpDeskQuickCallLogger.exe.config") 

But I can not read it in the meanings.

Any ideas?

+4
source share
2 answers

Here's how we handle this requirement if a specific configuration file (sSpecificConfigurationFile) is specified:

  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 
+1
source

I'm not sure if this is what you are looking for, but see if this Code Project article helps.

Description from the above article:

This article shows how to write a custom settings provider for letting you save your My.Settings settings in your own storage system.

0
source

Source: https://habr.com/ru/post/1383288/


All Articles