2

Here is the whole context:

  1. I build two nuget packages containing
    • A.nupkg: A.dll, A.Contracts.dll
    • B.nupkg: B.dll, B.Contracts.dll; B depends on A
  2. I create a new project and solution C depending on A and B, and set "Contract Reference Assembly" to Build.

Locally, everything compiles just fine. However, on the build server (MSBuild 2012.2), an exception is thrown from ccrewrite, saying ccrewrite : error : Rewrite aborted due to metadata errors. Check output window. Setting the logging to Diagnostics, I get the following:

Reading assembly 'B' from 'C:\Builds\1\Product\Build-Dev-CI\Sources\packages\B.1.2.13156.9\lib\net40\B.dll' resulted in errors. (TaskId:1284) Could not resolve type reference: [A.Class]A.Class. (TaskId:1284)

Any ideas why this does not work on the build server?

ioan
  • 722
  • 4
  • 12
  • still having this issue in Visual Studio 2017 and it is strange, since it is failing only on my machine... and solution clean, rebuild not helping, also tried Visual Studio repair - but same result – Prokurors Oct 26 '18 at 08:05
  • I know it is "a bit" late, but did you solve that issue somehow? – Prokurors Oct 26 '18 at 09:07
  • 1
    Well, I gave up using Code Contracts, as the new C# 8 will solve most of my preconditions problems, namely the non-nullability. P.S. Sorry for my late answer, too :(. – ioan Dec 17 '18 at 14:25

0 Answers0