本文介绍了Team Build 2010-第三方程序集引用未复制到输出文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在构建服务器上构建解决方案时,它会生成一个Binaries文件夹,然后将这些Binaries复制到最终输出文件夹中.在我的情况下,某些第三方程序集引用被正确地复制了,而其他第三部分程序集引用没有被复制.不要以为我的解决方案项目没有直接引用要复制的程序集.

When I build a solution on my build server it generates a binaries folder and then later on copies these binaries to the final output folder. In my case some of the third party assemblies REFERENCES are correctly copied over while other 3rd part assemblies REFERENCES are not copied over. Take not that my solution projects do not directly reference the assemblies being copied over.

这意味着一切正常.但是,当我运行程序时,它不会启动,因为它所引用的程序集无法依次加载其引用.

This means that everything build fine. But when I run my program it doesn't start since the assemblies it's referencing can't in turn load their references.

构建中的哪个过程确定将哪些程序集复制到binaries文件夹中?有什么方法可以指定应复制所有程序集吗?

What process in the build determines what assemblies are copied over to the binaries folder? Is there any way to specify that it should copy all assemblies?

一种可能的解决方案是仅引用该解决方案中一个项目中的所有必需程序集,但这会变得非常混乱.

Edit : One possible solution is to just reference all required assemblies in one of the projects in the solution but this gets very messy.

推荐答案

对于ASP.NET项目,有一个内置的机制.确保所需的程序集在您的项目下名为_bin_deployableAssemblies的文件夹中,并且它们将被自动复制.要查看如何将此自定义连接到Web项目的构建中,请找到文件...

For ASP.NET projects there is a built in mechanism for this. Ensure required assemblies are in a folder under your project named _bin_deployableAssemblies and they will get automatically copied. To see how this customization is wired into the build of Web projects, find the file...

%PROGRAMFILES%\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets

并查看_CopyBinDeployableAssemblies目标.在同一个文件中,您可以看到它像这样被引用...

And take a look at the _CopyBinDeployableAssemblies target. In that same file you can see it referenced like this...

<PropertyGroup>
  <PrepareForRunDependsOn>
    $(PrepareForRunDependsOn);
    CopySilverlightApplications;
    _CopyBinDeployableAssemblies;
  </PrepareForRunDependsOn>
  ...

您可以在任何项目上进行类似的自定义,因为目标PrepareForRun是Visual Studio中常见MSBuild目标的一部分.

You can do a similar customization on any project, since the target PrepareForRun is part of the common MSBuild targets in Visual Studio.

这篇关于Team Build 2010-第三方程序集引用未复制到输出文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:42