无法在asp.net核心上加载文件或程序集'System.Core,Version = 4.0.0.0?

时间:2016-12-01 04:53:34

标签: c# asp.net

我是asp.net核心的新手,也是我第一次尝试使用Web api项目

我的project.json:

  {
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    },
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Dapper": "1.50.2",
    "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
    "MicroOrm.Pocos.SqlGenerator": "1.0.0.3"

  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

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

在我输入""Microsoft.NETCore.Portable.Compatibility": "1.0.1"并导入

后,它显示Microsoft Application Insights上的错误
"imports": [
        "net461",

System.IO.FileLoadException 无法加载文件或程序集'System.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'。定位的程序集的清单定义与程序集引用不匹配。 (HRESULT异常:0x80131040) 在Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory..cctor(

的Web.config:

   <?xml version="1.0" encoding="utf-8"?>
<configuration>

  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->

  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

0 个答案:

没有答案