首页 新闻 会员 周边 捐助

将示例站点升级至ASP.NET Core RC2时遇到的问题

0
悬赏园豆:30 [已解决问题] 解决于 2016-05-17 17:07

操作系统是Ubuntu。

.NET Core SDK的版本是:

.NET Command Line Tools (1.0.0-preview1-002702)

prject.json文件的内容是:

{
    "compilationOptions": {
        "preserveCompilationContext": true,
        "emitEntryPoint": true
    },
    "dependencies": {
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
        "Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0-*"
        }
    },
    "frameworks": {
      "netcoreapp1.0": {
        "imports": [
          "portable-net45+wp80+win8+wpa81+dnxcore50",
          "portable-net45+win8+wp8+wpa81",
          "portable-net45+win8+wp8"
        ]
      }
    },

    "tools": {
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*"
    }
}

dotnet restore时的错误如下:

Unable to resolve 'Microsoft.AspNetCore.IISPlatformHandler (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
Package Newtonsoft.Json 7.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Newtonsoft.Json 7.0.1 supports:
  - net20 (.NETFramework,Version=v2.0)
  - net35 (.NETFramework,Version=v3.5)
  - net40 (.NETFramework,Version=v4.0)
  - net45 (.NETFramework,Version=v4.5)
  - portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
  - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
dudu的主页 dudu | 高人七级 | 园豆:29568
提问于:2016-05-17 15:37
< >
分享
最佳答案
0

在project.json中

1)参考这里

"tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*"
}

改为

"tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools":{
        "version":"1.0.0-*",
        "imports": "portable-net45+win8+dnxcore50"
    }
}

解决了“Package Newtonsoft.Json 7.0.1 is not compatible with netcoreapp1.0”的问题。

2)将

Microsoft.AspNetCore.IISPlatformHandler

改为

Microsoft.AspNetCore.Server.IISIntegration

解决了不能解析 Microsoft.AspNetCore.IISPlatformHandler 的问题。

dudu | 高人七级 |园豆:29568 | 2016-05-17 17:05
其他回答(2)
0

因为 Newtonsoft.Json 7.0.1 不兼容?

收获园豆:30
life++ | 园豆:312 (菜鸟二级) | 2016-05-17 16:28
0

请问我的outputpath是自定义的生成的到另一个目录下的结构和原来的一到处,使用IOC时如何调试呢? ResolvedPath不是预期的值啊

manaide-个人助手 | 园豆:204 (菜鸟二级) | 2016-05-18 14:10

我对这个没经验

支持(0) 反对(0) dudu | 园豆:29568 (高人七级) | 2016-05-18 14:35
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册