3

I'm Working on WCF Service with target .net framework is 4.6

I've already gone through this question : Question

But my problem is somewhat different here.

Earlier I was using older version of Microsoft Enterprise Libraries and now I've have to move towards updated version [I found them on nuget].

Version of Microsoft.Practices.EnterpriseLibrary.Common library was 5.0.414.0 and now I have update version 6.0.1304.0.

Same way for other two (Caching 5.0.414.0 to 5.0.505.0 and Logging 5.0.414.0 to 6.0.1304.0)

For that I have changed reference to dll accordingly and also in configuration file.

But while trying to create a Cache Manager, I'm getting an exception like below.

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.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)

Odd thing here is version number for common library, it was never 5.0.505.0. Instead this version number is supposed to be of new library of caching. Thus I'm assuming this problem isn't only related to Common library (or isn't related to common library) but related to caching too.

EDIT:

I had one other project using the same dlls (reference path is same for both). In that project, I'm just using Logging dll only. After replacing old dlls with newer ones, in this project too I'm having similar problem.

Only difference is Earlier Logging dll version was 5.0.414.0 and now 6.0.1304.0

as version number in exception matches with current version umber I'm assuming that now it is looking in correct dll

and I'm having exception like

loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.1304.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)

Can anyone help me to get the situation and possible solution for it.

Amit
  • 1,821
  • 1
  • 17
  • 30
  • The first thing id do, is remove all the references and reinstall the nugets. make sure you do it for all your other projects in the solution. also clean and rebuild, add pepper and salt to taste – TheGeneral Apr 05 '18 at 07:23
  • @TheGeneral There is only one project referring this libraries in my current solution, and I've already done all things which you have suggested. However there is another project (in another solution) using them.. should i do the same for that solution too ? – Amit Apr 05 '18 at 07:25
  • I smell shenanigans... make sure the other project in the other solution has all the referenced removed and nugets updated as well. – TheGeneral Apr 05 '18 at 07:27
  • @TheGeneral okay. I'll comeback after trying that. Thanks – Amit Apr 05 '18 at 07:28
  • what version do you have referenced? – Simon Price Apr 05 '18 at 07:29
  • @simom earlier version was 5,0,414,0 now i have changed it to 6.0.1304.0.. I have mentioned that in question too. – Amit Apr 05 '18 at 07:33
  • @TheGeneral , No. After removing all ref and adding them back in my other project. now I'm having problem in that project too. See my edit – Amit Apr 05 '18 at 10:48
  • @Amit what .net framework are you targeting – TheGeneral Apr 05 '18 at 10:53
  • @TheGeneral .Net 4.6 ..It is there in first line of question – Amit Apr 05 '18 at 10:53
  • Yeah this has me stumped, even looking at similar questions point to the same solution – TheGeneral Apr 05 '18 at 10:54
  • @TheGeneral Are there any chances that Enterprise libraries I'm referring are not inter-compatible ? Logging and Common library is 6.0.1304.0 , Caching is 5.0.505.0! – Amit Apr 05 '18 at 10:57
  • Seems unlikely, however this might be worthy of a small bounty, hopefully someone has a keener eye for this problem – TheGeneral Apr 05 '18 at 11:00
  • Bounty will be eligible after two days ! – Amit Apr 05 '18 at 11:01

0 Answers0