如果你在更新dotnet core新的類庫后運行程序提示如下的錯誤:
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":{}
}
或者 可以修改Microsoft.NETCore.App節點的內容如下,Version的版本請對應你的dotnet core版本號"Microsoft.NETCore.App":{
"type":"platform",
"version":"1.0.1"
}
