Reputation: 470
I have more than one solution projects for an application with using one app.config for each solution.
Can i do a separate configuration file (other than app.config) for common setting like db name (connection string) ? Because currently i put these setting in each and every app.config file.
Upvotes: 0
Views: 255
Reputation: 1831
Please try following.
Create one config called "common.config" like below which will be common to all solutions and let's say it's located @ "E:/myconfig". Please keep all common setting in this config.
<appSettings> <add key="connstring" value="conn string value" /> </appSettings>
Now link this common config in you specific solution config lets say web.config using file attribute
<configuration>
<appSettings file="E:\myconfig\Common.config"> <add key="key1" value="value" />
</appSettings>
</configuration>
Hope this will work for you.
Upvotes: 1