NullReference
NullReference

Reputation: 4484

Is it possible to share ApplicationSettings across projects?

I have a multi project solution where one application is a mvc web application and the others are dlls. I really like that ApplicaitonSettings are strongly typed. It would be great to have application settings shared across the different projects .I found that configSource allows you to store the settings in a separate xml file, but they must be contained within the project directory. This lead me to adding the file via a link but then I run into the problem where the namespaces are different, such as Web.Properties.Settings vs Service.Properties.Settings. Has anyone been able to do something like this?

<applicationSettings>
    <NAMESPACE.Properties.Settings>
        <setting name="Test" serializeAs="String">
            <value>Test</value>
        </setting>
    </NAMESPACE.Properties.Settings>
</applicationSettings>

Upvotes: 0

Views: 445

Answers (1)

Emmanuel N
Emmanuel N

Reputation: 7449

Yes, config files are hierarchical. So you can put the settings you want to be shared by multiple application at an appropriate level

Upvotes: 2

Related Questions