Nunit3 shows System.AggregateException from an assembly that does not exist with that version

0

This is the error:

Message: System.AggregateException : One or more errors occurred.
----> System.IO.FileLoadException : Could not load file or assembly 'Microsoft.AspNet.SignalR.Client, Version=2.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

  • We are only running version 2.3.0 of Microsoft.AspNet.SignalR.Client.
  • I ran a grep over the whole solution and could not find a single instance which does not use 2.3.0. or runs the version mentioned in the error
  • The test itself does not have a reference to this library
  • I deleted all bin folders, cleaned and rebuilded.

Update: I am pretty sure the problem is not nunit. Rather it shows the symptons. How do you go about finding out where this reference is used? App.configs for example only show ranges:

<assemblyIdentity name="Microsoft.AspNet.SignalR.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
nunit
nunit-3.0
asked on Stack Overflow Sep 7, 2018 by Thypari • edited Sep 7, 2018 by Thypari

1 Answer

0

I added an app.config in the test project and in the project that the test is running in which I declared:

<assemblyIdentity name="Microsoft.AspNet.SignalR.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />

Now the exception is gone. Still I don't think this is the right solution. Normally visual studio must know which assembly version is the right one without declaring an app.config every time.

answered on Stack Overflow Sep 7, 2018 by Thypari

User contributions licensed under CC BY-SA 3.0