Visual Studio 安装项目 Team Build 输出与本地构建不同
我有一个 Visual Studio 2010 安装项目 (.vdproj
),它经常出现问题。尽管我尝试从项目文件中排除或删除它,但安装项目中存在一个依赖项,该依赖项包含在安装程序中。我可以使用 Visual Studio 从依赖项中排除程序集,然后生成项目,并且本地计算机上的输出将不包括排除的程序集。当我签入项目并使用 TFS (2008) 进行构建时,程序集始终包含在内。
有问题的程序集是我排除的多个程序集之一,因为它们已经作为项目输出包含在设置项目中。因此,安装程序最终可能会得到同一程序集的两个副本,如果它尝试将它们写入同一位置(GAC 或 bin 文件夹),则安装会失败,并显示 文件使用错误。
我经常会发现,当我重新打开安装项目时,排除标志已恢复为false。
这确实非常烦人,并且浪费了大量时间,因为现在我使用 Orca 加载每个构建,以尝试确保输出中不存在重复的程序集。有什么办法可以解决这个问题吗?
I have a Visual Studio 2010 setup project (.vdproj
) that constantly misbehaves. There is a dependency in the setup project that gets included in the installer despite my attempts to exclude it or delete it from the project file. I can exclude the assembly from the dependencies using Visual Studio, then build the project, and the output on my local machine will not include the excluded assembly. When I check in the project and build using TFS (2008), the assembly is always included.
The assembly in question is one of a number I exclude because they are already included in the setup project as project outputs. So the installer can end up with two copies of the same assembly and if it attempts to write them to the same location, either the GAC or the bin folder, the installation fails with a file in use error.
And often I'll find that when I re-open the setup project, the Exclude flag has reverted to false.
This is really quite annoying and wastes a fair amount of time because now I use Orca to load up each build to try to ensure that the duplicate assemblies aren't present in the output. Is there any way to resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Visual Studio 安装项目基本上已被弃用,并且已经很长时间没有看到重大工作了。除了您看到的问题之外,他们在与 Team Build 结合时还存在许多其他问题。
请参阅:http://msdn.microsoft.com/en-us/library/ee721500 .aspx
看看 Wix 作为这些项目的替代品。
Visual Studio Setup Projects are essentially deprecated and haven't seen major work in ages. Apart from the issue you're seeing, they have a lot of other issues in combination with Team Build.
See: http://msdn.microsoft.com/en-us/library/ee721500.aspx
Have a look at Wix as a replacement for these projects.
我在 msdn 上找到了此页面,该页面有一个解决方法排除标志被重置为False:
不幸的是,这个解决方案对我不起作用,因为安装项目是针对 ASP.NET 网站的,但 Microsoft 解决方法已记录在此处以供将来参考。
我想我已经确定了为什么存在依赖性。该网站引用了许多项目的项目成果。预编译站点后,将构建引用的项目程序集并将其放入 bin 文件夹中。然后,安装项目将它们标识为依赖项,尽管安装项目已经包含这些项目的项目输出。我在安装项目中使用项目输出的原因是因为 TFS 喜欢签入预编译的 Web 文件夹中包含的 dll,该文件夹是解决方案文件结构的一部分。这有时会导致生成的安装程序中出现旧版本或不正确版本的 dll。
我的解决方法是编辑 TFSBuild.proj 文件并添加一个任务以从预编译的 bin 目录中删除这些 dll。然后在构建安装程序时它们将不会被识别为依赖项。
I found this page on msdn that has a work-around for the Exclude flag being reset to False:
Unfortunately this solution isn't going to work for me because the setup project is for an ASP.NET website but the Microsoft work-around is documented here for future reference.
I think I've established why the dependency is present. The website references the project outputs from a number of projects. When the site is precompiled, the referenced project assemblies are built and dropped into the bin folder. The setup project then identifies them as dependencies, despite the setup project already including the project outputs for those projects. The reason I use the project outputs in the setup project is because TFS likes to checkin dlls contained in the precompiled web folder which is part of the file structure of the solution. This has sometimes resulted in old or incorrect versions of dlls being present in the resulting installer.
The work-around for me is to edit the TFSBuild.proj file and add a task to delete those dlls from the precompiled bin directory. Then they won't be identified as dependencies when building the installer.