project.json中的框架和导入部分:它们是什么? [英] Frameworks and imports sections in project.json: what are they?
问题描述
ASP.NET Core 1.0项目的project.json
文件的frameworks
和imports
部分到底是什么,它们做什么?我一直在尝试查找官方"文档以更好地理解它.
What exactly are the frameworks
and imports
sections of the project.json
file of a ASP.NET Core 1.0 project and what do they do? I've been trying to find "official" documentation to understand it better.
这是我最近在Yeoman-scaffolded ASP.NET项目中启动的样例:
Here's a boilerplate example from a recent Yeoman-scaffolded ASP.NET project I started up:
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
推荐答案
-
frameworks
是您的应用程序支持的目标框架的列表. -
imports
是一种使用不是为该框架设计的软件包的方法.基本上,您告诉它即使似乎不受支持,也要使用这些目标.我知道我在做什么". frameworks
is the list of target frameworks that you application supports.imports
is a way to use packages that were not designed for that framework. Basically you tell it "Use those targets even though they don't seem to be supported. I know what I'm doing".
这里有一个要点,可以为您提供更多洞察力,以了解各种TFM(目标框架Monikers)如何相互映射 https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
Here's a gist that might give you more insights into how various TFMs (Target Framework Monikers) map to each other https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
这篇关于project.json中的框架和导入部分:它们是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!