回到目錄 新建console項目之後,編譯程式出現以下錯誤: Can not find runtime target for framework '.NETCoreAPP, Version=v1.0' compatible with one of the target runtimes: 'win1 ...
新建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上運行!