1. 程式人生 > >DotNetCore跨平臺~問題~NETCoreAPP, Version=v1.0' compatible with one of the target runtimes: 'win10-x64

DotNetCore跨平臺~問題~NETCoreAPP, Version=v1.0' compatible with one of the target runtimes: 'win10-x64

回到目錄

新建console專案之後,編譯程式出現以下錯誤:

Can not find runtime target for framework '.NETCoreAPP, Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
        The project has not been restored or restore failed -run 'dotnet restore'
        The project does not list one of 'win10-x64, win81-x64, win7-x64' in the 'runtimes'

解決方案:

開啟project.json

將以下程式碼新增到根節點

  "runtimes": {
    "win10-x64": {}
  },

新增後的樣子如下:

以上問題就可以得到解決了,事實上就是告訴dotnet core 這個專案要在64位的windows上執行!

回到目錄