获取正确的合并配置构建MSI文件 [英] Getting correct merged config building MSI file

查看:88
本文介绍了获取正确的合并配置构建MSI文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将MSI文件添加到通常以一键式部署方式部署到服务器的应用程序中.我们对app.config进行了许多配置转换,而我只是更改了现有配置,以将生产服务器合并到app部分.

正常(未合并的设置-服务默认为localhost):

I''m adding an MSI file to an application normally deployed to the servers as a One-Click deployment. We have numerous configuration transforms for the app.config and I just changed the existing one to merge production servers into the app section.

Normal (unmerged setting -- default to localhost for services):

<appSettings file="c:\config\SERVPRO.WorkCenter.FranchiseClient.user.config">
  <add key="placeholder" value="SoThisWillNotGoAway" />
  <add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>



发行版的合并版本:



The merged version for release:

<appSettings xdt:Transform="Replace">
  <add key="DataServerHostName" value="prduction server naem"/>
  <add key="AuthenticationServerHostName" value="production server name"/>
  <add key="DataServerPortNumber" value="666"/>
  <add key="AuthenticationServerPortNumber" value="666"/>
  <add key="DisplayLocationInformation" value="True"/>
  <add key="Location" value="Production"/>
</appSettings>



现在,我进入并验证了a)msi构造确实抓取了应用程序配置文件-和-b)应用程序配置中包含生产服务器的发布数据.

当我安装应用程序并检查文件时,我在安装的文件中获得了app.config的非合并版本,而不是应用程序生成的输出!如果进入并删除了除发行版以外的所有构建实例,我仍然会得到它.

MSI创建是否构造app.config => program.exe.config本身,并忽略了转换???如果是这样,我现在需要手动告诉它以从Release文件夹中获取正确的文件,而不是使用项目输出吗?

任何帮助是极大的赞赏.我在谷歌搜索中找不到任何内容.



Now I have gone in and verified that a) the msi construction does grab the app config file --and-- b) the app config contains the release data for the production servers.

When I install the application and inspect the files I get the non-merged version of app.config in the installed files instead of the output from the build of the application!!! If gone in and deleted all instances of the build except release and I still get this.

Does the MSI creation construct the app.config => program.exe.config itself and overlooks the transforms??? If so am I now required to tell it manually to get the correct file from the Release folder, rather than use the project output?

Any help is greatly appreciated. I''ve not found anything on this in my googling.

推荐答案

我认为在MSI创建/编译过程中,添加的app.config属于未合并的文件路径.如果是这种情况,则需要手动获取更新的文件.

honeyashu
I think during MSI creation/compilation the added app.config belongs to the unmerged file path. If this is the case it will be needed to get updated file manually.

honeyashu


此后,我发现Microsoft安装程序项目根本不希望app.config文件被转换.这样,即使被告知接受项目输出,它也会在内部创建app.config本身.

解决方法是,我必须删除所有项目参考文件,然后在Release目录中手动加载输出.这是可以接受的解决方法,因为我们仅希望此版本基于软件的发行版.

我还发现,即使仅选择可执行文件也是不可接受的,因为安装程序项目不会安装它找到的所有依赖文件.因此,我不得不复制所有相关程序集并接受有关重复文件的多种警告.
I have since found that the Microsoft Setup project does not expect the app.config file to be transformed at all. As such, even though it is told to take the project output, it creates the app.config itself internally.

As a workaround I had to remove all of the project reference files and manually load up the output in the Release directory. This is acceptable as a workaround since we only want this build on the Release version of the software.

I also found that even selecting just the executable was not acceptable since the setup project did not install all of the files it found as dependent. Thus I had to copy all dependent assemblies and accept the multitude of warnings about duplicate files.


这篇关于获取正确的合并配置构建MSI文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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