Can not find runtime target for framework .NETCoreApp=v1 compatible with one of the target runtimes for some projects

五迷三道 提交于 2019-11-29 03:52:11

What exactly does this runtime definition means?

runtimes lists the runtimes that our package supports. Listing runtimes is necessary for self-contained deployments. A deployment is self-contained when it brings its own runtime.

How do we know if our deployment is self-contained? dependencies list the packages on which our package depends. These dependencies come in three types.

  • build the package is for building only and is not part of the deployment
  • platform the package will depend on a pre-installed runtime
  • default neither of those

If our "Microsoft.NETCore.App" dependency is of the default type, then it is self-contained, and we will need to bring our own runtimes. If it is of the platform type, then it is framework dependent.

why was this happening only on some projects?

It will only happen in projects that are self-contained deployments. If you look thru those projects that do not require a runtimes property, you will find that they are either class libraries or framework dependent.

self-contained deployment

 "frameworks": {
   "netcoreapp1.0": {
     "dependencies": {
       "Microsoft.NETCore.App": {
          "version": "1.0.0"
       }
     }
   }
 },
 "runtimes": {
   "win10-x64": {},
   "osx.10.10-x64": {}
 }

framework dependent deployment

 "frameworks": {
   "netcoreapp1.0": {
     "dependencies": {
       "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
       }
     }
   }
 }

class library

 "frameworks": {
   "netstandard1.6": {}
 }

how does it affect my ability to run on other os like linux or mac?

It doesn't. Windows, Mac OS, and Linux can all either have a runtime pre-installed or have the application bring its own runtime.

See also

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!