开发者

Use a dynamically generated file as configSource in web.config

开发者 https://www.devze.com 2022-12-15 14:55 出处:网络
Is there a way to use a generated file as a configSource for a web.config section? In web.config, I tried a simple:

Is there a way to use a generated file as a configSource for a web.config section?

In web.config, I tried a simple:

<webParts configSource="webpartsConfig.asp开发者_如何学Pythonx" />

where webpartsConfig.aspx just spits out XML when accessed normally, but not as a configSource. (The literal source code is included as-is, giving an error.) Any solutions or alternatives?

Motivation for this solution: I have different configuration variables locally and online, and I don't want to juggle multiple config files.


Hopefully this doesn't come too late to help, but I would suggest looking at an adaption of the source used in Enterprise Library. Details - http://blogs.msdn.com/tomholl/archive/2006/04/02/entlib2externalconfig.aspx

Then you would be creating a custom ConfigurationSource that reads HttpWebResponses.

0

精彩评论

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