无法加载类型'Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions'

时间:2017-02-21 17:01:19

标签: c# asp.net-core asp.net-core-mvc entity-framework-core

我在startup.cs中收到以下错误: 无法从程序集中加载“Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions”类型: https://i.stack.imgur.com/pdn9g.png 和运行时内部服务器错误: https://i.stack.imgur.com/XjMML.png

这是我的project.json文件:

  {
  "dependencies": {
    "AutoMapper": "4.2.1",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.EntityFrameworkCore": "1.0.1",
    "Microsoft.EntityFrameworkCore.Design": {
      "version": "1.0.1",
      "type": "build"
    },

    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
    "Microsoft.EntityFrameworkCore.Tools.DotNet": {
      "version": "1.0.0-preview3-final",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    }
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview3-final",
    "Microsoft.EntityFrameworkCore.Tools.DotNet": {
      "version": "1.0.0-preview3-final",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "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%" ]
  }
}

我知道这是一个依赖性错误,但我无法弄清楚在哪里。如果我将Microsoft.AspNetCore.Identity.EntityFrameworkCore版本从“1.0.0-rc2-final”更改为“我也会遇到依赖冲突问题” 1.0.0" 。

0 个答案:

没有答案