开发者

Using one app setting variable definition in another app setting variable

开发者 https://www.devze.com 2023-02-16 01:30 出处:网络
Is there a way to use one app sett开发者_StackOverflowing variable definition in another app setting variable?

Is there a way to use one app sett开发者_StackOverflowing variable definition in another app setting variable?

This is an example, right now I have:

<add key="P4RootDirectory" value="d:\p4\" />
<add key="P4LocalBranchSyncDirectory" value="d:\p4\sw\matt\" />

Ideally, I would like to have something like this

<add key="P4RootDirectory" value="d:\p4\" />
<add key="P4LocalBranchSyncDirectory" value="%P4RootDirectory%sw\matt\" />

Is this not possible? Would I have to do this in my code?


You will need to do this in code. If you use a DI injection framework that would be a great place to setup and automatically do the replace before injecting the final string into some constructor for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消