I have a window application in vs 2022 and also setup the installer (.msi) with application. It is working fine till now but as per new requirement i need to add config file and add all credential over there. I added there and now my application is correctly reading values from app.config but problem is when i create Installer (.msi) after install that on another machine then application is not reading value from app.config file. I don't want to use any third party tool. Please help on this
App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<appSettings>
<add key="MySetting" value="HelloWorld" />
</appSettings>
</configuration>
Windows App: read config sample
//using System.Configuration;
string mySettingValue = ConfigurationManager.AppSettings["MySetting"];
MessageBox.Show("MySetting value: " + mySettingValue);
Right click installer project -> View -> File system
Right click Application Folder -> Add -> Project output
Select the Windows app project - > Primary output