我有一个小项目,我想要有2个编译版本:
- one that is targetting the .NET 2.0 framework
- one that is targetting the .NET 3.5 framework
一切进行得很顺利;我将我的项目置于持续集成(使用CC.NET),并创建了2个CC.NET项目。一个项目用于每个目标框架。
我不会深入(不相关的)细节,但是我的解决方案是针对VS.NET中的.NET 3.5框架进行设置的。
我有两个msbuild任务:
- one task that builds the solution for .NET 3.5 (simple and easy)
one task that builds the solution for .NET 2.0
在这个任务中,我调用MSBuild,并指定目标框架版本应为v2.0。我还定义了一些额外的构建条件(以便不会在面向.NET2.0的程序集中构建特定于.NET3.5的代码)。
So far, so good. Everything works fine. Now, the problem however is this:
My solution has a few dependencies (references to 3rd party assemblies). In VS.NET, I ve set copy local to true for these dependencies. When CC.NET builds my .NET3.5 version of the assembly, the 3rd party dependencies are indeed copied to my output-directory.
然而,当CC.NET生成我的.NET 2.0版本程序集时,依赖项并未复制到我的输出目录中。(这导致我的单元测试失败)。
My question now is: How can I say to msbuild that certain of the 3rd party references have to be copied local when building my .NET2.0 version of my project ? Or, is there any other way to achieve this, since, I wouldn t like to specify every dependency once again in my build-script. This would quickly become a maintenance nightmare, I guess.