title: Asp.net Core EF options.UseInMemoryDatabase System.TypeLoadException
body: <p>I used EF in Asp.net Core, but got below error in below code:</p>
  
  <pre><code>public class TodoContext : DbContext
  {
      public TodoContext(DbContextOptions&lt;TodoContext&gt; options)
          : base(options)
      {
  
      }
      public DbSet&lt;TodoItem&gt; TodoItems { get; set; }
  
  }
  </code></pre>
  
  <p>Error Message:  </p>
  
  <blockquote>
    <p>An exception of type 'System.TypeLoadException' occurred in
    Microsoft.EntityFrameworkCore.dll but was not handled in user code</p>
    
    <p>Additional information: Could not load type
    'Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions'
    from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions,
    Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.</p>
  </blockquote>
  
  <p>Here is my Project.json</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.NETCore.App": {
        "version": "1.0.1",
        "type": "platform"
      },
      "Microsoft.AspNetCore.Diagnostics": "1.0.0",
  
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      //Dependence for MVC
      "Microsoft.AspNetCore.Mvc": "1.1.1",
      "Microsoft.AspNetCore.StaticFiles": "1.1.0",
      "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
      "Microsoft.Extensions.Configuration.Json": "1.1.0",
      //Dependence for EF
      "Microsoft.EntityFrameworkCore": "1.1.0",
      "Microsoft.EntityFrameworkCore.InMemory": "1.0.0-rc2-final"
      //Dependence for EF with SQL, this is avalible under VS 2017 RC
      //"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
      //Entity Framework commands to maintain the database
      //"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final"
    },
  
    "tools": {
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
    },
  
    "frameworks": {
      "netcoreapp1.0": {
        "imports": [
          "dotnet5.6",
          "portable-net45+win8"
        ]
      }
    },
  
    "buildOptions": {
      "emitEntryPoint": true,
      //used for Razor pages which are compiled at runtime,and the compiler needs access to reference assemblies,
      //to make sure it compiles correctly
      "preserveCompilationContext": true
    },
  
    "runtimeOptions": {
      "configProperties": {
        "System.GC.Server": true
      }
    },
  
    "publishOptions": {
      "include": [
        "wwwroot",
        "web.config"
      ]
    },
  
    "scripts": {
      "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    }
  }
  </code></pre>
  
  <p>Any help would be appreciated.<br>
  Reards,<br>
  Edward  </p>