不同的app.config的ClickOnce应用程序

不同的app.config的ClickOnce应用程序

问题描述:

我们有一个的ClickOnce部署的应用程序部署在2个不同的地方。 两者都需要在App.config一些不同的设置(另外devel软件包环境)

We have a ClickOnce deployed application deployed at 2 different places. Both need some different settings in the app.config (In addition the devel environment)

现在这些发电设施的过程是有人从Visual Studio手动更改这些设置和重建。这是ofcourse一种痛苦。

Right now the process of generating these installations is for someone to manually change these settings from visual studio and rebuild. This is ofcourse a pain.

有些人建议我们让我们的解决方案中的一个额外的项目谁pretty的多只包含app.settings,只是运行在其他项目中的主要形式。

Some suggested we make an additional project within our solution who pretty much only contains the app.settings and just run the main form in the other project.

人们如何处理呢?

(我在寻找具体的解决方案/例子,使用自动生成系统可能是目标,但它不是很具体的。)

(I'm looking for concrete solutions/examples, "use an automated build system" might be the goal but it's not very concrete..)

我觉得有两种解决方法:

I think there are two solutions:

  • 正如你所说,创建多项目。该项目基本上是重新present正确的app.config,右deploment配置等,否则它只是代表的cflow了real'-项目$ C $。
  • 另一种可能性是创建多个的app.config文件。像APP-develop.config =>开发-版本,APP-productive.config =>生产-版本,应用程序,其他-thing.config ...现在你添加一个额外的任务给的MSBuild文件(.csproj的)该份合适的应用程序 - *配置到的app.config文件。我们做这样的事情在我们的日志配置和它工作正常。