NuGet Conflict

Josh

Posted on
Mar 21 2017

I have a shared library that uses Mindscape.Raygun4Net. That shared library is used by several things (asp.net app, web api, windows service, etc.). However, our API is generating the following warning:

Found conflicts between different versions of the same dependent assembly that could not be resolved.
These reference conflicts are listed in the build log when log verbosity is set to detailed.

This seems to be because it references Mindscape.Raygun4Net.Core which has the exact same library inside of it as Mindscape.Raygun4Net.

Here's the relevant msbuild log portion:

  Dependency "Mindscape.Raygun4Net4, Version=5.4.1.0, Culture=neutral, PublicKeyToken=null".
      Resolved file path is "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net4.dll".
      Reference found at search path location "C:\svn\box3\Shared\NLog.Raygun\bin\Debug".
          For SearchPath "C:\svn\box3\Shared\NLog.Raygun\bin\Debug".
          Considered "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net4.winmd", but it didn't exist.
      Required by "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\NLog.Raygun.dll".
      Found related file "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net4.pdb".
      The ImageRuntimeVersion for this reference is "v4.0.30319".
  Dependency "Mindscape.Raygun4Net, Version=5.4.1.0, Culture=neutral, PublicKeyToken=null".
      Resolved file path is "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net.dll".
      Reference found at search path location "C:\svn\box3\Shared\NLog.Raygun\bin\Debug".
          For SearchPath "C:\svn\box3\Shared\NLog.Raygun\bin\Debug".
          Considered "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net.winmd", but it didn't exist.
      Required by "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\NLog.Raygun.dll".
      Found related file "C:\svn\box3\Shared\NLog.Raygun\bin\Debug\Mindscape.Raygun4Net.pdb".
      This reference is not "CopyLocal" because it conflicted with another reference with the same name and lost the conflict.
      The ImageRuntimeVersion for this reference is "v4.0.30319".

Given that using Mindscape.Raygun4Net in a Web API project but is recommended in a class library, what is Raygun's recommended solution for this conflict?


Josh

Posted on
Mar 30 2017

Anyone? Bueller?


Jason Fauchelle

Raygun

Posted on
Mar 31 2017

Hi Josh,

Sorry for the late reply. This warning is caused by multiple versions of the same assembly being available. We've released a new version of the Raygun4Net.WebApi NuGet package to match the latest version of Raygun4Net.dll used in the Raygun4Net package.

Please update your Raygun4Net.WebApi NuGet package (and the .Core dependency package) to the latest version (5.4.1), clean and rebuild your solution to solve the warning.

-Jason Fauchelle


Reply