Frage

We are using moles 0.94 for some tests in our solution. However, every time it gets first compiled, the build server will raise a couple of warnings:

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.

My understanding is that the build server will try to resolve all the references of the test project before starting to build, and if it cannot find the moles dll under the molesassembly folder (because in the first time, it's empty), it will generate a warning like the above.

But when msbuild starts to build this test project, the mole assemblies will be generated and copied into the moleassemblies folder, so it won't turn into an error.

In summary, for the first time, the build will partially succeed and the next time build will fully succeed.

We are trying not to have any warnings on the build server. Is there any way we can eliminate this warnning on the build server?

War es hilfreich?

Lösung

We have all 3rd party assemblies stored in the Assemblies folder in the project's root folder. All 3rd party assemblies used in any of our projects are referenced from this location. Assemblies folder is included in the TFS.

It seems like you are referencing XXX.Moles assemblies from the output folder instead of some common (Assemblies) folder. Try to update your references to use 3rd party libraries from Assemblies folder instead of output folder of your test project.

EDIT: Try to add check if XXX.Moles assembly exists into Reference tag e.g.:

<Reference Condition="Exists('..\molesassemblies\XXX.Moles.dll')" Include="XXX.Moles.dll">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\molesassemblies\XXX.Moles.dll</HintPath>
</Reference>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top