我可以创建config文件,它包括web.config文件? [英] Can I create .config file and include it to web.config?

查看:132
本文介绍了我可以创建config文件,它包括web.config文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以创建config文件,它包括web.config文件?
我怎样才能做到这一点?

UPD。
如果你想单独的配置文件,例如,移动的appSettings到另一个文件,则必须采取以下行动:在web.config中

 <的appSettings configSource =myAppSettings.config/>

在myAppSettings.config:

 <&的appSettings GT;
    <添加键=ClientValidationEnabledVALUE =真/>
    <添加键=UnobtrusiveJavaScriptEnabledVALUE =真/>
  < /的appSettings>


解决方案

这是不完全清楚你想要做什么,但所有配置部分可以被存储在一个单独的文件,并通过主的.config 使用<文件href=\"http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource.aspx\"><$c$c>configSource属性。

请参阅this博客文章的详细信息。

Can I create .config file and include it to web.config? How can i do this?

UPD. If you want to separate config file, for example, move appSettings to another file you must do next: In web.config

  <appSettings configSource="myAppSettings.config" />

In myAppSettings.config:

  <appSettings>
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>

解决方案

It is not entirely clear what you want to do, but all configuration sections can be stored in a separate files and be referenced by the main .config file using the configSource property.

See this blog post for details.

这篇关于我可以创建config文件,它包括web.config文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆