Visual Studio 设置项目预构建事件
我有一个 Visual Studio 安装项目,其中一些部署的文件是由预构建事件创建的。但是,当我构建项目时,Visual Studio 首先进行预构建验证,然后运行预构建事件。因此,预构建验证失败,并显示错误消息“错误:无法找到文件...”。
有谁知道这个问题的解决方法?
(细节可能并不重要,但它是 Python 应用程序的 Windows Installer。预构建事件调用 PyInstaller,它将 py 文件打包为单个 exe 文件。然后,该 exe 文件以及一些 DLL 和资源文件由将项目设置为 Windows Installer。)
I have a Visual Studio Setup project where some of the deployed files are created by a pre-build event. However, when I build the project Visual Studio first does pre-build validation and then runs the pre-build event. Thus pre-build validation fails, with the error message "ERROR: Unable to find file ...".
Does anyone know a work-around for this?
(The details may not matter, but it is a Windows Installer for a Python app. The pre-build event calls PyInstaller which packages the py files as a single exe file. This exe file and some DLL's and resource files are then packaged by the Setup project as a Windows Installer.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须能够使用 MSBuild 目标而不是预构建事件。我不确定具体细节,但我猜想以下 链接 可能会解释您的类似情况。
编辑 - 2017 年 7 月(由于重新定位链接):
http://pradeepc.net/using- tfs-teambuild-to-build-setup-projects-in-visual-studio
从该链接复制的示例粘贴在下面 - 您可能需要进行编辑以满足需要:
You must be able to use MSBuild Targets instead of a Prebuild Event. I am not sure about the specifics, but I guess the following link might explain your similar situation.
Edited - July 2017 (due to relocated link):
http://pradeepc.net/using-tfs-teambuild-to-build-setup-projects-in-visual-studio
Sample copied from that link is pasted below - you may want to edit to fit the need: