title: Deployment ASP.NET Core 1.1.0 & Entity Framework Core 1.1 : Unable to load assembly system.Collections.Immutable, Version=1.1.37.0
body: <p>I migrated my project to ASP.NET Core 1.1.0 and Entity Framework Core 1.1, and all is working fine in develoment.</p>
  
  <p>But impossible to deploy the project in staging, I have this error from stdout logs :</p>
  
  <blockquote>
    <p>Application startup exception: System.IO.FileLoadException: Impossible
    de charger le fichier ou l'assembly
    'Microsoft.Extensions.DependencyInjection.Abstractions,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' ou
    une de ses d‚pendances. La d‚finition trouv‚e du manifeste de
    l'assembly ne correspond pas … la r‚f‚rence de l'assembly. (Exception
    de HRESULT : 0x80131040) Nom de fichierÿ:
    'Microsoft.Extensions.DependencyInjection.Abstractions,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'<br>
    … Agata.Presentation.Web.Startup.ConfigureServices(IServiceCollection
    services)
    --- Fin de la trace de la pile … partir de l'emplacement pr‚c‚dent au niveau duquel l'exception a ‚t‚ lev‚e ---    …
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    …
    Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection
    services)    …
    Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
    … Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()</p>
  </blockquote>
  
  <p>I checked all the nuget packages from all the projects contained in the solution and all the dependencies are up to date.</p>
  
  <p>I've deleted all the staging's directory and redeploy it completely to be sure there is no old dlls but the error is still here.
  I also restart the IIS pool and the website, several times.</p>
  
  <p>And .NET Core 1.1.0 is installed on the server.</p>
  
  <p>Anyone has an idea on what's going on here ?</p>
  
  <p>EDIT : this is my project.json :</p>
  
  <pre><code> "dependencies": {
      "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
      "Microsoft.AspNetCore.Diagnostics": "1.1.0",
      "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final",
      "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview3-final",
      "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview3-final",
      "Npgsql": "3.1.6",
      "Remotion.Linq": "2.1.1",
      "Serilog.Sinks.RollingFile": "3.2.0",
      "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
      "Microsoft.AspNetCore.StaticFiles": "1.1.0",
      "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
      "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
      "Microsoft.Extensions.Configuration.Binder": "1.1.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
      "Microsoft.Extensions.Configuration.Json": "1.1.0",
      "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
      "Microsoft.Extensions.Logging.Console": "1.1.0",
      "Microsoft.Extensions.Logging.Debug": "1.1.0",
      "Serilog.Extensions.Logging": "1.3.0",
      "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
      "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
      "Microsoft.AspNetCore.Mvc": "1.1.0",
      "Microsoft.Extensions.Logging": "1.1.0",
      "Microsoft.EntityFrameworkCore": "1.1.0",
      "System.Interactive.Async": "3.1.0",
      "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
      "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
    },
  
    "tools": {
      "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
      "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
    },
  </code></pre>
  
  <p><strong>EDIT: The problem is different now, the error now is :</strong> </p>
  
  <blockquote>
    <p>Application startup exception: System.IO.FileLoadException:
    Impossible de charger le fichier ou l'assembly
    'System.Interactive.Async, Version=3.0.0.0, Culture=neutral,
    PublicKeyToken=94bc3704cddfc263' ou une de ses d‚pendances. La
    d‚finition trouv‚e du manifeste de l'assembly ne correspond pas … la
    r‚f‚rence de l'assembly. (Exception de HRESULT : 0x80131040)
        Nom de fichierÿ: 'System.Interactive.Async, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'
           … Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddQuery(IServiceCollection
    serviceCollection)
           … Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddEntityFramework(IServiceCollection
    serviceCollection)
           … Microsoft.EntityFrameworkCore.Infrastructure.RelationalServiceCollectionExtensions.AddRelational(IServiceCollection
    services)
           … Microsoft.Extensions.DependencyInjection.SqlServerServiceCollectionExtensions.AddEntityFrameworkSqlServer(IServiceCollection
    services)
           … Agata.Presentation.Web.Startup.ConfigureServices(IServiceCollection
    services) dans
    C:\Workspace\PerformancesEtControles\Agata\DevLot1\Presentation\Agata.Presentation.Web\Startup.cs:ligne
    65
        --- Fin de la trace de la pile … partir de l'emplacement pr‚c‚dent au niveau duquel l'exception a ‚t‚ lev‚e ---
           … System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           … Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection
    services)
           … Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
           … Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()</p>
  </blockquote>
  
  <p>This is my updated project.json :</p>
  
  <pre><code> "dependencies": {
      "Npgsql": "3.1.6",
      "Remotion.Linq": "2.1.1",
      "Serilog.Sinks.RollingFile": "3.2.0",
      "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
      "Microsoft.AspNetCore.StaticFiles": "1.1.0",
      "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
      "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
      "Microsoft.Extensions.Configuration.Binder": "1.1.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
      "Microsoft.Extensions.Configuration.Json": "1.1.0",
      "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
      "Microsoft.Extensions.Logging.Console": "1.1.0",
      "Microsoft.Extensions.Logging.Debug": "1.1.0",
      "Serilog.Extensions.Logging": "1.3.0",
      "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
      "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
      "Microsoft.AspNetCore.Mvc": "1.1.0",
      "Microsoft.Extensions.Logging": "1.1.0",
      "Microsoft.EntityFrameworkCore": "1.1.0",
      "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
      "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
      "System.Interactive.Async": "3.1.0"
    },
  
    "tools": {
      "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
      "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
    },
  </code></pre>
  
  <p>The line 65 of my startup file is :</p>
  
  <pre><code>services.AddEntityFrameworkSqlServer().AddDbContext&lt;MyDbContext&gt;(options =&gt; options.UseSqlServer(Configuration.GetConnectionString("MyDbConnectionString")));
  </code></pre>
  
  <p>It's still working fine in debug with visual studio ...</p>
  
  <p><strong>EDIT 2 :</strong> I resolved the <em>System.Interactive.Async</em> updating the <em>Serilog.Extensions.Logging</em> package... I have now the error :</p>
  
  <blockquote>
    <p>System.IO.FileLoadException: Impossible de charger le fichier ou
    l'assembly 'System.Collections.Immutable, Version=1.1.37.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou une de ses
    dépendances. La définition trouvée du manifeste de l'assembly ne
    correspond pas à la référence de l'assembly. (Exception de HRESULT :
    0x80131040) Nom de fichier : 'System.Collections.Immutable,
    Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'<br>
    à
    Microsoft.AspNetCore.Mvc.Razor.Internal.RazorReferenceManager..ctor(ApplicationPartManager
    partManager, IOptions`1 optionsAccessor)
    --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---</p>
  </blockquote>
  
  <p>I'm just going crazy with this deployment ...</p>
  
  <p><strong>SOLUTION :</strong> deploy the web application executable's configuration file, who contains some class library dependency bindings</p>