0

I am adding a Web Reference in my website. Reference is added successfully. But when i add namespace in my webpage it give me following error.

Error   22  Reference.svcmap: Could not load file or assembly  
 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot
 find the file specified. App_WebReferences/FaxService/ 

Namespace name I give to my web reference is "FaxService".

In pages.aspx.cs page I have added

using FaxService;

What I have tried.

1) Removed web reference and add it again.

2) Update web refernce

3) Uninstall newton soft from "Pakage Manager Console" and removed all the dll's of newtonsoft from my solution.

PM> UnInstall-Package Newtonsoft.Json

4) Installed newton soft again through "Pakage Manager Console".

PM> Install-Package Newtonsoft.Json

5) Adding following lines in web.config

 <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
  </dependentAssembly>
</assemblyBinding>

This web reference is not newly added. It was working fine before.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
Fazal Wahid
  • 175
  • 2
  • 17

1 Answers1

0

Error says about Version=6.0.0.0, try to find where is reference to it? But your web.config uses 7.0.0.0. Try to find reference to 6.0.0.0 and delete it.

My thoughts are: - maybe one of dependencies of it was updated and now it cannot be loaded? - use option "DELETE ALL" before deploy, maybe something old is there in deployment directory.

P.K.
  • 1,746
  • 6
  • 25
  • 62
  • After reinstalling pakage. error is updated to "**Error 40 Reference.svcmap: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. App_WebReferences/FaxService/**" – Fazal Wahid Jul 24 '15 at 09:44
  • go to project references, select JSON library file, open properties and see which version of library you are using. – P.K. Jul 24 '15 at 09:49