InstallShield VStudio项目正在安装app.config文件,而不是合并的MyApp.exe.config [英] InstallShield VStudio project is installing app.config file instead of merged MyApp.exe.config

查看:79
本文介绍了InstallShield VStudio项目正在安装app.config文件,而不是合并的MyApp.exe.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用InstallScript C#.Net向导连接到WinForms解决方案,在该解决方案中,我使用了依赖扫描程序来标识项目输出.

Using a InstallScript C# .Net Wizard to connect to a WinForms solution where I used the dependency scanner to identify project outputs.

安装包将未合并的app.config文件复制到目标目录,而不是将解决方案合并的MyApp.exe.config文件复制到目标目录.这样会导致可执行文件无法正确获取配置文件设置,这不仅是因为该文件的命名不正确,而且还不能在目标环境设置(即发行,调试等)中合并.

The install package is copying the un-merged app.config file to the target directory instead of the solutions merged MyApp.exe.config file. This results in a executable that does not properly pickup configuration file settings not only because the file isn't named correctly but it also does not merge in target environment settings (ie. release, debug, etc.).

您如何让安装程序将合并的MyApp.exe.config文件复制到安装目录?

How do you have the Installer copy the merged MyApp.exe.config file to the Install Directory?

推荐答案

尝试一下,我相信这应该可行.

Try this, I believe this should work.

选择配置文件,然后在文件.属性"下的复制到输出目录"中,选择始终复制"或如果更新则复制".您可以使用此方法选择所需的任何文件.基本上,此文件将放置在生成二进制文件的目录中.我认为,与从InstallShield进行配置/修复相比,这仍然是一种更好的方法.如果您不同意,我希望收到您的来信.

Select the config file, and in the Copy to Output Directory under File.Properties, choose Copy always or Copy if newer. You can choose any file you like with this method. Basically this file will be placed to a directory where the binaries are built. This is still a better method than configuring/fixing from InstallShield, I think. I will like to hear from you, if you disagree.

另一件事,使用配置文件,并在运行时通过代码确定配置文件.这可能就是InstallShield不知道其文件依赖性的原因.而且超出了该工具的范围.

Another thing, a config file is used and determined at run-time by code. That’s probably the reason why InstallShield does not know the file dependency on it. And it is out of scope for that tool.

玩得开心,让我知道会发生什么.

Have fun and let me know what happens.

汤米·奎

这篇关于InstallShield VStudio项目正在安装app.config文件,而不是合并的MyApp.exe.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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