Base solution for your next web application
Open Closed

Could not load file or assembly 'Newtonsoft.Json' #1502


User avatar
0
cicciottino created

Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependecy

i've just done:

  1. Downloaded the template (07/08/2016, i suppose 0.10.3.0 abp version)
  2. Update-Package (success)
  3. Update-Database (success)
  4. Play (debug)
  5. Got the error

I've tried to unistall and reinstall the package "Newtownsoft.json 9.0.1" but it did not resolve the problem. Could you help me to resolve or investigate on this problem?

These are the details from the error page (sorry, the language is italian):

[Assembly load trace]

=== Informazioni sullo stato di preassociazione ===
REG: DisplayName = Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
 (Fully-specified)
REG: Appbase = file:///C:/Users/a.pinato/Desktop/tempate aspnet application/MaiPuiSprechi/MaiPuiSprechi.Web/
REG: PrivatePath iniziale = C:\Users\a.pinato\Desktop\tempate aspnet application\MaiPuiSprechi\MaiPuiSprechi.Web\bin
Assembly chiamante: Microsoft.AspNet.SignalR.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
REG: l'associazione ha origine nel contesto di caricamento di default.
REG: utilizzo del file di configurazione dell'applicazione: C:\Users\a.pinato\Desktop\tempate aspnet application\MaiPuiSprechi\MaiPuiSprechi.Web\web.config
REG: utilizzo del file di configurazione host: C:\Users\a.pinato\Documents\IISExpress\config\aspnet.config
REG: utilizzo del file di configurazione computer da C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
REG: trovato reindirizzamento nel file di configurazione dell'applicazione: 6.0.0.0 reindirizzato a 9.0.0.0.
REG: riferimento post-criteri: Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
REG: tentativo di download del nuovo URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/23b8e119/1bfe6ada/Newtonsoft.Json.DLL.
REG: tentativo di download del nuovo URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/23b8e119/1bfe6ada/Newtonsoft.Json/Newtonsoft.Json.DLL.
REG: tentativo di download del nuovo URL file:///C:/Users/a.pinato/Desktop/tempate aspnet application/MaiPuiSprechi/MaiPuiSprechi.Web/bin/Newtonsoft.Json.DLL.
REG: tentativo di download del nuovo URL file:///C:/Users/a.pinato/Desktop/tempate aspnet application/MaiPuiSprechi/MaiPuiSprechi.Web/bin/Newtonsoft.Json/Newtonsoft.Json.DLL.
REG: tentativo di download del nuovo URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/23b8e119/1bfe6ada/Newtonsoft.Json.EXE.
REG: tentativo di download del nuovo URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/23b8e119/1bfe6ada/Newtonsoft.Json/Newtonsoft.Json.EXE.
REG: tentativo di download del nuovo URL file:///C:/Users/a.pinato/Desktop/tempate aspnet application/MaiPuiSprechi/MaiPuiSprechi.Web/bin/Newtonsoft.Json.EXE.
REG: tentativo di download del nuovo URL file:///C:/Users/a.pinato/Desktop/tempate aspnet application/MaiPuiSprechi/MaiPuiSprechi.Web/bin/Newtonsoft.Json/Newtonsoft.Json.EXE.

[Stack trace]

[FileNotFoundException: Impossibile caricare il file o l'assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' o una delle relative dipendenze. Impossibile trovare il file specificato.]

[FileNotFoundException: Impossibile caricare il file o l'assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' o una delle relative dipendenze. Impossibile trovare il file specificato.]
   Microsoft.AspNet.SignalR.DefaultDependencyResolver.RegisterDefaultServices() +0
   Microsoft.AspNet.SignalR.DefaultDependencyResolver..ctor() +84
   Abp.Web.SignalR.AbpWebSignalRModule.PreInitialize() in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.SignalR\Web\SignalR\AbpWebSignalRModule.cs:18
   Abp.Modules.<>c.<StartModules>b__16_0(AbpModuleInfo module) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:47
   System.Collections.Generic.List`1.ForEach(Action`1 action) +11439282
   Abp.Modules.AbpModuleManager.StartModules() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:47
   Abp.AbpBootstrapper.Initialize() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\AbpBootstrapper.cs:138
   Abp.Web.AbpWebApplication`1.Application_Start(Object sender, EventArgs e) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web\Web\AbpWebApplication.cs:36
   MaiPuiSprechi.Web.MvcApplication.Application_Start(Object sender, EventArgs e) in C:\Users\a.pinato\Desktop\tempate aspnet application\MaiPuiSprechi\MaiPuiSprechi.Web\Global.asax.cs:12

[HttpException (0x80004005): Impossibile caricare il file o l'assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' o una delle relative dipendenze. Impossibile trovare il file specificato.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9964625
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Impossibile caricare il file o l'assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' o una delle relative dipendenze. Impossibile trovare il file specificato.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Some questions for you:

  • is it something related to SignalR? Do i need to install something on my machine?
  • in the stack trace i see some your local paths: D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.SignalR\Web\SignalR\AbpWebSignalRModule.cs (could it be a problem?)
  • it reports 2 different version of Newtonsoft.Json: Version=6.0.0.0 and Version=9.0.0.0 (why???)

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Do you have an assembly binding on your web config ? Adding something like this might solve your problem.

    <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
      </dependentAssembly>
    
  • User Avatar
    0
    cicciottino created

    Thanks a lot, it works!