我们在解决方案中使用了 moles 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文件夹中,因此它不会变成错误。
总之,第一次构建将部分成功,下一次构建将完全成功。
我们正在努力避免在构建服务器上出现任何警告。有没有办法消除构建服务器上的这个警告?