在编译.NET 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'.

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’的解决办法-程序旅途

解决办法很简单,在错误里面就已经提到了找不到“.NETCoreApp,Version=v1.0”,那么我们就需要在project.json的dependencies里加入如下的依赖:

    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    }

具体可以参考这篇文章https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/,介绍了.NET Core程序两种部署类型