开发者

What's easier custom .config file or use XML in asp.net

I have a situation where I temporarily need to save a bunch of settings to a new website. Essentially one web service will make the s开发者_JAVA技巧ite and it will dump a bunch of data. I'd rather not store it in the site's app.config.

I could either save all the data as xml or make a file called install.config

Then later on the install wizard can reference it.

MY question is, what's easier? using XML or reading from a custom config file?

thanks!


@aron:

Based on your comments you are simply creating alternative app settings per site. Therefore you can create your web.config as normal but source the appsettings from the external install.config using:

<configuration>
   <appSettings configSource="install.config" />
</configuration>

The benefit of this approach is that you do not need to write any bespoke clases / code to read the values as you can then simply use the usual config calls from your code;

ConfigurationManager.AppSettings["MyInstallSetting"]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜