I have two .csproj files in my app that both generate an .exe and both have C# programs that need values from the app.config. So since there can only be one app.config file (they're build into the same folder) I thought I'd just put the values that the second program (let's call it b.cs/b.exe) needs in the app.config of the .csproj of the first program (a.cs/a.exe). But the second program can't seem to access the app.config. It's there and the values are there but when I run string x = ConfigurationManager.AppSettings["BuildVersion"];, x is always empty. If I run the same code from a.exe it works fine. It's as if the app.config has some info imbedded in the .exe file that I'm not able to see or set anywhere.
Any ideas how I can access values in anapp.config from two separate projects?
You can leave the
app.config in one project, but add it as a linked (virtual) file in the other project. Instructions from here Including content files in .csproj that are outside the project cone