WiX& MSBuild:App.Config 中无法识别的属性
我已经为此绞尽脑汁两天了...
我有一个由 MSBuild 在我的 Team Foundation Server 上构建的 WiX 项目。我设置了构建定义,并且在大约两周内一切运行良好。然后,我向 WiX 正在打包的项目的 app.config 中的自定义部分添加了一个额外的属性...
当我在本地构建时,WiX 生成的 MSI 安装完美 - 没有错误。当我使用构建定义在 TFS 上进行构建,然后在本地复制 MSI 以测试安装时,我收到“无法识别的属性 CustomAttribute
。请注意,属性名称区分大小写。”在我的安装失败之前,事件查看器中出现错误。
我故意挂起安装,以便可以看到安装目录中的文件,然后查看 app.config。 CustomAttribute
在我的自定义部分中定义了一个值。然后我使用 dotPeek 并查看可执行文件,我的 ConfigurationSection 类中的属性使用正确的 ConfigurationPropertyAttribute 进行修饰,并且拼写是正确的。该属性按预期返回 this[CustomAttribute
].ToString()。
那么我错过了什么?任何线索将不胜感激。
编辑(附加信息) MSBuild 似乎正在获取错误版本的自定义部分源文件。我将源文件设置为复制到输出目录,以便我可以看到它正在使用哪一个,并在构建过程中标记了该文件,并且这两个文件都显示了正确的文件。然而,在应用程序中,使用了错误的文件。所以我倾向于项目问题而不是 WiX 或 TFS 问题,但我们三个致力于此的人无法弄清楚......
I have been banging my head against this one for two days...
I have a WiX project that is built by MSBuild on my Team Foundation Server. I have a Build Definition set up, and all was working well for about two weeks. Then I added an extra attribute to the custom section in the app.config of the Project that WiX is packaging...
When I build locally, the MSI generated by WiX installs perfectly - no errors. When I build on TFS using the Build Definition then copy the MSI locally to test the install, I get "Unrecognized Attribute CustomAttribute
. Note that attribute names are case-sensitive." error in Event Viewer before my installation fails.
I intentionally hang the installation so I can see the files in the installation directory, and I look at the app.config. CustomAttribute
is defined with a value in my custom section. Then I use dotPeek and look at the executable, and the property in my ConfigurationSection class is decorated with the correct ConfigurationPropertyAttribute, and the spelling is correct. The property returns this[CustomAttribute
].ToString(), as expected.
So what am I missing? Any clues would be appreciated.
EDIT (Additional Information)
It appears that MSBuild is grabbing the wrong version of the Custom Section source file. I set the source file to be copied to the output directory so I could see which one it is using, and also labeled the file during the build, and both of those display the correct file. However, in the application, the wrong file is used. So I'm leaning towards a Project issue instead of a WiX or TFS issue, but three of us working on this cannot figure it out...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从您的问题中不清楚安装程序正在使用 app.config 文件做什么。除非安装程序以某种方式读取文件,否则我不会认为其中的内容有什么关系?
我无法就您的问题提供任何具体建议(如果问题在被询问几个月后仍然悬而未决),但我可以建议使用 Orca 来读取 MSI 表,并使用 7zip 来提取 MSI 中的文件。通过检查 Orca 中的 MSI,我得到了许多 MSI 问题的答案。
It's not clear from your question what the installer is doing with the app.config file. Unless the installer is reading the file somehow, I wouldn't have thought it would matter what content is in it?
I can't offer any specific advice on your issue (if it's still outstanding, months after being asked), but I can suggest the use of Orca for reading the MSI table, and 7zip for extracting the files within the MSI. I've gotten answers to many of my MSI questions by examining MSIs in Orca.