设置移动到另一个配置文件

设置移动到另一个配置文件

本文介绍了设置移动到另一个配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能的applicationSettings移动到另一个配置文件,因为它是可能的是connectionStrings或的appSettings?

Is it possible to move applicationSettings to another config file as it is possible with connectionStrings or appSettings?

当我创建使用设计,我得到的applicationSettings节我的web.config如我的Web应用程序设置:

When I create Settings for my web application using the designer I get applicationSettings section in my web.config such as:

  <applicationSettings>
    <TestWebApplication.Properties.Settings>
      <setting name="AnotherSetting" serializeAs="String">
        <value>Another setting value</value>
      </setting>
    </TestWebApplication.Properties.Settings>
  </applicationSettings>

我希望能够将它们移动到其他文件一样的appSettings:

I would like to be able to move them to another file like appSettings:

<appSettings configSource="config\appsettings.config"/>

我正在与拥有大量通过与设计师和web.config中生成的类访问设置一个项目是非常难多种环境之间保持。它甚至会更好,如果我能迫使设置类使用的appSettings没有的applicationSettings。

I'm working with a project that has lots of settings accessed through class generated with designer and web.config is extremely hard to maintain between multiple environments. It would be even better if I could force Settings class to use appSettings not applicationSettings.

这可能吗?

预先感谢帮助。

推荐答案

这个问题没有标记为答案相当长的时间。
那么,marc_s答案下有解释,这是不可能的意见。我不想标记marc_s答案为接受的答案,因为评论说比答案正好相反的事。
因此,答案是,不幸的是,这是不可能的。

This question was not marked as answer for quite a long time.Well, under marc_s answer there are comments that explain that this is impossible. I didn't want to mark marc_s answer as accepted answer because the comments say exactly opposite thing than the answer.So the answer is that, unfortunately, it is not possible.

这篇关于设置移动到另一个配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 03:05