I want to link multiple projects App Config file into my Single Unit Test Project in DotNet framework in C#, As I wanted to access the different config files for different test methods. Can anyone help me how should I make this done?
When I want to share files across multiple projects what I usually do is:
This tells the project to reference something externally. In visual studio it will show as if it lives under the project like any other kind of file.
NB you may have to then change the properties of that linked file to make sure it is handled properly on build. So you may or may not want it copied to the build directory for example.
If you don't have visual studio then you can add this to the project file...
<ItemGroup>
<AdditionalFiles Include="<PathToFile>\<Filename>" Link="<Filename>" />
</ItemGroup>
This is an example from one of my projects
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.