在安装项目中使用 SlowCheetah 的 app.config 转换
我正在使用 SlowCheetah XML Transforms 扩展来处理 Web。使用 app.config 进行类似配置的转换。那部分效果很好。
我添加了一个安装项目并将其配置为包含第一个项目的项目输出。我注意到当我运行安装程序时,它安装了未转换的 app.config。查看主输出(快 10 倍),我注意到它在 Project\bin\Debug\Project.exe
中找到了二进制文件,但是 Project.exe.config 来自
Project\app.config
而不是 Project\bin\Debug\Project.exe.config
。
我可以从主输出中排除 app.config,并将路径硬编码到特定配置的 app.config (Project\bin\Debug\Project.exe.config
),但随后我会无论我使用哪种配置来构建它,都会获得相同的 app.config 。
是否有解决方法可以在安装项目中获取适当的转换后的 app.config?
I'm using the SlowCheetah XML Transforms extension to handle web.config-like transformations with app.config. That part works great.
I added a setup project and configured it to include the project output of the first project. I noticed that when I ran the installer, it installed the non-transformed app.config. Looking at the Primary output Outputs (say that 10 times fast), I noticed that its finding the binary in Project\bin\Debug\Project.exe
, but Project.exe.config
comes from Project\app.config
instead of Project\bin\Debug\Project.exe.config
.
I could exclude app.config from the Primary output, and hard-code the path to a specific configuration's app.config (Project\bin\Debug\Project.exe.config
), but then I'd get the same app.config regardless of which configuration I used to build it.
Is there a workaround for getting the appropriate transformed app.config in a Setup project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您好,我们计划在未来几天内发布支持 ClickOnce 的新版本。如果您需要构建之前已修复的插件,请与我联系,我可以将其发送给您。
Hi we are planning on releasing a new version which has ClickOnce support in the next few days. If you need a build of the add in before than which has the fix please contact me and I can get that out to you.
这可能不完全是您正在寻找的答案,但我之前一直在努力解决如何将正确的 app.config 文件放入安装项目中。我有一个使用转换的 TFSBuild.proj msbuild 文件。我认为 SlowCheetah 转换使用相同的 msbuild 任务,但我可能是不正确的。在处理转换文件时,SlowCheetah 无疑提供了更有用的用户体验。我的构建文件采用了稍微不同的方法。在自动构建结束时,我想为每个目标部署环境生成安装程序。我使用了许多 msbuild 扩展,包括 TransformXml 构建任务 - 并非以下所有必需的,但 FWIW 这些是导入:
我定义了以下环境:
然后是标准 AfterCompileSolution target 包含对为每个环境生成安装程序的目标的调用:
This may not be exactly the answer you're looking for but I have previously wrestled with how to get the correct app.config file into a setup project. I have a TFSBuild.proj msbuild file that uses transforms. The SlowCheetah transforms I think use the same msbuild task but I may be incorrect. SlowCheetah certainly provides a more useful user experience when working with transform files. My build file takes a slightly different approach. At the end of the automated build I wanted to generate installers for each of the target deployment environments. I use a number of msbuild extensions, including the TransformXml build task - not all required for the following but FWIW these are the imports:
I have the following environments defined:
Then the standard AfterCompileSolution target contains a call to the target that generates the installer for each environment: