C# / Visual Studio
Share a file between multiple projects?
Fx. share app.config to Test project:
Step 1: Place the App.Config file in a folder parent to both(or all) the projects that needs to use the same Config file. I have put it in a new folder called AppConfig. [Actually it don’t have to be parent to both]
Step 2: Right click on each project and select the same App.config file but add it as Link. [That’s the important part]
It is a little different if we talk about web.config:
Here I found that you can put a pre-build event to the target project. Fx. a UnitTest project where you depend on web.config:
copy “$(SolutionDir)\SourceProject_RENAME\[web.config]” “$(ProjectDir)$(OutDir)$(TargetFileName).config”