msbuild TransformWebConfig 任务 - 不适用于 App.configs?
我有一个 Windows 服务,需要与 web.configs 使用相同类型的转换,但 VS 2010 似乎不支持这一点。我尝试手动添加 App.Release.Config 文件,然后使用 msbuil [PROJ] /T:TransformWebConfig /p:Configuration=Release 但不执行任何转换。我在 obj 子目录中创建了一个 TransformWebConfig 文件夹,但仅此而已。
这个东西是否被硬编码为只能与 web.configs 一起使用?
I have a windows service that will need to have the same kind of transformations that the web.configs would use, but VS 2010 doesn't seem to support that. I've tried manually adding the App.Release.Config files, and then using msbuil [PROJ] /T:TransformWebConfig /p:Configuration=Release but no transformation is performed. I got a TransformWebConfig folder createed in my obj subdirectory, but that's it.
Is this thing hardcoded to only work with web.configs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,TransformWebConfig 任务设计用于 web.config
(文件:$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets行:199)
但是您可以通过以下方式使其工作:
设置 <将 App.config 文件的 Build Action 设置为 Content
将 ProjectConfigFileName 的值设置为 App.config :
Yes, the TransformWebConfig task is designed to work on web.config
(File: $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets Line: 199)
But you could make it work by :
Setting the Build Action of your App.config file to Content
Setting the value of ProjectConfigFileName to App.config :
我遇到了同样的问题,并发现了一篇文章,详细介绍了如何完成转换 app.config 文件:
http://vishaljoshi.blogspot.com/2010/05/applying-xdt-magic-to-appconfig.html
我完成了这些步骤,并成功地能够改变我的应用程序配置文件。
I was having the same issue and came across an article that details how to accomplish transforming app.config files:
http://vishaljoshi.blogspot.com/2010/05/applying-xdt-magic-to-appconfig.html
I walked through the steps and was successfully able to transform my app.config file.
您现在可以使用名为 SlowCheetah 的插件来转换,而不仅仅是应用程序.configs,但使用相同转换引擎的任何 xml 文件
You can now use a plugin called SlowCheetah to transform not only app.configs but any xml files using the same transformation engine