title: Could not load type from assembly - ASP.NET Core
body: <p>I am getting the following error when adding middleware for MVC to ASP.NET Core solution</p>
  
  <p>System.TypeLoadException
  Could not load type 'Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions' from assembly 
  'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.</p>
  
  <pre><code>Line 26:          public void ConfigureServices(IServiceCollection services)
  Line 27:          {
  Line 28:              services.AddMvc();
  Line 29:              services.AddSingleton(provider =&gt; Configuration);
  Line 30:              services.AddSingleton&lt;IGreeter, Greeter&gt;();
  
   at Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.AddOptions(IServiceCollection services) 
  at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services, Action&lt;MvcOptions&gt; setupAction) 
  at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services, Action&lt;MvcOptions&gt; setupAction) 
  at OdeToFood2.Startup.ConfigureServices(IServiceCollection services) in C:\Users\aindriu\documents\visual studio 2015\Projects\OdeToFood2\src\OdeToFood2\Startup.cs:line 28
  System.Reflection.TargetInvocationException
  Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle.InvokeMethod(object target, Object[] arguments, Signature sig, bool constructor) 
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(object obj, Object[] parameters, Object[] arguments) 
  at System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
  at Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder.Invoke(object instance, IServiceCollection exportServices) 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
  </code></pre>
  
  <p>My dependencies in the project.json file are </p>
  
  <pre><code>    {
    "dependencies": {
      "Microsoft.NETCore.App": {
        "version": "1.0.0",
        "type": "platform"
      },
      "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
      "Microsoft.AspNetCore.Diagnostics": "1.0.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      "Microsoft.Extensions.Configuration.Json": "1.0.0",
      "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
      "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
      "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
      "Microsoft.AspNetCore.StaticFiles": "1.0.0",
      "Microsoft.AspNetCore.Mvc.Core": "1.0.0",
      "Autofac.Extensions.DependencyInjection": "4.0.0-rc3-309"
    },
  </code></pre>
  
  <p>Is there a conflict between different versions in the json file ? </p>
  
  <p>here is my solution - </p>
  
  <p><a href="https://dl.dropboxusercontent.com/u/10629841/OdeToFood2.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/10629841/OdeToFood2.zip</a> </p>