我们在我们的解决方案中使用摩尔 0.94 进行一些测试。但是,每次首次编译时,构建服务器都会发出几个警告:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference.
Could not locate the assembly "XXX.Moles, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL".
Check to make sure the assembly exists on disk.
If this reference is required by your code, you may get compilation errors.
我的理解是构建服务器在开始构建之前会尝试解析测试项目的所有引用,如果在molesassembly文件夹下找不到moles dll(因为第一次是空的),它会生成一个像上面这样的警告。
但是当msbuild开始构建这个测试项目的时候,会生成mole组件并复制到moleassemblies文件夹中,所以不会报错。
综上所述,第一次构建会部分成功,下次构建会完全成功。
我们试图在构建服务器上不出现任何警告。有什么办法可以消除构建服务器上的这个警告吗?