[asp.net core]project.json(2)
摘要
上篇文章介绍了project.json中的一部分属性。属性真的比较多,所以分开了,考虑到其中的英文比较简单,也不再进行翻译了,从英文原文中,直接粘贴过来了。
project.json
publicSign
Type: Boolean
true
to enable signing of the resulting assembly; otherwise, false
. The default is false
.
For example:
{
"buildOptions": {
"publicSign": true
}
}
debugType
Type: String
Indicates the type of symbol file (PDB file) to generate. The options are "portable" (for .NET Core projects) or "full" (the traditional Windows-only PDB files).
For example:
{
"buildOptions": {
"debugType": "portable"
}
}
xmlDoc
Type: Boolean
true
to generate XML documentation from triple-slash comments in the source code; otherwise, false
. The default is false
.
For example:
{
"buildOptions": {
"xmlDoc": true
}
}
preserveCompilationContext
Type: Boolean
true
to preserve reference assemblies and other context data to allow for runtime compilation; otherwise, false
. The default is false
.
For example:
{
"buildOptions": {
"preserveCompilationContext": true
}
}
outputName
Type: String
Change the name of the output file.
For example:
{
"buildOptions": {
"outputName": "MyApp"
}
}
compilerName
Type: String
The name of the compiler used for this project. csc
by default. Currently, csc
(the C# compiler) or fsc
(the F# compiler) are supported.
For example:
{
"compilerName": "fsc"
}
compile
Type: Object
An object containing properties for compilation configuration.
include
Type: String or String[] with a globbing pattern.
Specifies which files to include in the build. The patterns are rooted at the project folder. Defaults to none.
For example:
{
"include":["wwwroot", "Views"]
}
exclude
Type: String or String[] with a globbing pattern.
Specifies which files to exclude from the build. The exclude patterns have higher priority than the include patterns, so a file found in both will be excluded. The patterns are rooted at the project folder. Defaults to none.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
includeFiles
Type: String or String[] with a globbing pattern.
A list of file paths to include. The paths are rooted at the project folder. This list has a higher priority than the include and exclude globbing patterns, hence a file listed here and in the exclude globbing pattern will still be included. Defaults to none.
For example:
{
"includeFiles": []
}
excludeFiles
Type: String or String[] with a globbing pattern.
A list of file paths to exclude. The paths are rooted at the project folder. This list has a higher priority than globbing patterns and the include paths, hence a file found in all will be excluded. Defaults to none.
For example:
{
"excludeFiles":[],
}
builtIns
Type: Object
The defaults provided by the system. It can have include
and exclude
globbing patterns which are merged with the corresponding values of the include
and exclude
properties.
For example:
{
"builtIns":{}
}
mappings
Type: Object
Keys to the object represent destination paths in the output layout.
Values are either a string or an object representing the source path of files to include. The object represtation can have its own include
, exclude
, includeFiles
and excludeFiles
sections.
String example:
{
"mappings": {
"dest/path": "./src/path"
}
}
Object example:
{
"mappings": {
"dest/path":{
"include":"./src/path"
}
}
}
embed
Type: Object
An object containing properties for compilation configuration.
include
Type: String or String[] with a globbing pattern.
{
"include":["wwwroot", "Views"]
}
exclude
Type: String or String[] with a globbing pattern.
Specifies which files to exclude from the build.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
includeFiles
Type: String or String[] with a globbing pattern.
{
"includeFiles":[],
}
excludeFiles
Type: String or String[] with a globbing pattern
{
"excludeFiles":[],
}
builtIns
Type: Object
{
"builtIns":{}
}
mappings
Type: Object
Keys to the object represent destination paths in the output layout.
Values are either a string or an object representing the source path of files to include. The object represtation can have its own include
, exclude
, includeFiles
and excludeFiles
sections.
String example:
{
"mappings": {
"dest/path": "./src/path"
}
}
Object example:
{
"mappings": {
"dest/path":{
"include":"./src/path"
}
}
}
copyToOutput
Type: Object
An object containing properties for compilation configuration.
include
Type: String or String[] with a globbing pattern.
{
"include":["wwwroot", "Views"]
}
exclude
Type: String or String[] with a globbing pattern.
Specifies which files to exclude from the build.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
includeFiles
Type: String or String[] with a globbing pattern
{
"includeFiles":[],
}
excludeFiles
Type: String or String[] with a globbing pattern.
{
"excludeFiles":[],
}
builtIns
Type: Object
{
"builtIns":{}
}
mappings
Type: Object
Keys to the object represent destination paths in the output layout.
Values are either a string or an object representing the source path of files to include. The object represtation can have its own include
, exclude
, includeFiles
and excludeFiles
sections.
String example:
{
"mappings": {
"dest/path": "./src/path"
}
}
Object example:
{
"mappings": {
"dest/path":{
"include":"./src/path"
}
}
}
publishOptions
Type: Object
An object containing properties for compilation configuration.
include
Type: String or String[] with a globbing pattern.
{
"include":["wwwroot", "Views"]
}
exclude
Type: String or String[] with a globbing pattern.
Specifies which files to exclude from the build.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
includeFiles
Type: String or String[] with a globbing pattern
{
"includeFiles":[],
}
excludeFiles
Type: String or String[] with a globbing pattern.
{
"excludeFiles":[],
}
builtIns
Type: Object
{
"builtIns":{}
}
mappings
Type: Object
Keys to the object represent destination paths in the output layout.
Values are either a string or an object representing the source path of files to include. The object represtation can have its own include
, exclude
, includeFiles
and excludeFiles
sections.
String example:
{
"mappings": {
"dest/file": "./src/file",
"dest/folder/": "./src/folder/**/*"
}
}
Object example:
{
"mappings": {
"dest/file":{
"include":"./src/file"
},
"dest/folder/":{
"include":"./src/folder/**/*"
}
}
}
runtimeOptions
Type: Object
Specifies parameters to be provided to the runtime during initialization.
configProperties
Type: Object
Contains configuration properties to configure the runtime and the framework.
System.GC.Server
Type: Boolean
true
to enable server garbage collection; otherwise, false
. The default is false
.
For example:
{
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
}
}
System.GC.Concurrent
Type: Boolean
true
to enable concurrent garbage collection; otherwise, false
. The default is false
.
For example:
{
"runtimeOptions": {
"configProperties": {
"System.GC.Concurrent": true
}
}
}
System.GC.RetainVM
Type: Boolean
true
to put segments that should be deleted on a standby list for future use instead of releasing them back to the operating system (OS); otherwise, false
. The default is false
.
For example:
{
"runtimeOptions": {
"configProperties": {
"System.GC.RetainVM": true
}
}
}
System.Threading.ThreadPool.MinThreads
Type: Integer
Overrides the number of minimum threads for the ThreadPool worker pool.
{
"runtimeOptions": {
"configProperties": {
"System.Threading.ThreadPool.MinThreads":
}
}
}
System.Threading.ThreadPool.MaxThreads
Type: Integer
Overrides the number of maximum threads for the ThreadPool worker pool.
{
"runtimeOptions": {
"configProperties": {
"System.Threading.ThreadPool.MaxThreads":
}
}
}
framework
Type: Object
Contains shared framework properties to use when activating the application. The presence of this section indicates that the application is a portable app designed to use a shared redistributable framework.
name
Type: String
Name of the shared framework.
{
"runtimeOptions": {
"framework": {
"name": "Microsoft.DotNetCore"
}
}
}
version
Type: String
Version of the shared framework.
{
"runtimeOptions": {
"framework": {
"version": "1.0.1"
}
}
}
applyPatches
Type: Boolean
true
to use the framework from either the same or a higher version that differs only in the SemVer
patch field. false
for the host to use only the exact framework version. The default is true
.
{
"runtimeOptions": {
"applyPatches": false
}
}
packOptions
Type: Object
Defines options pertaining to the packaging of the project output into a NuGet package.
summary
Type: String
A short description of the project.
For example:
{
"packOptions": {
"summary": "This is my library."
}
}
tags
Type: String[]
An array of strings with tags for the project, used for searching in NuGet.
For example:
{
"packOptions": {
"tags": ["hyperscale", "cats"]
}
}
owners
Type: String[]
An array of strings with the names of the owners of the project.
For example:
{
"packOptions": {
"owners": ["Fabrikam", "Microsoft"]
}
}
releaseNotes
Type: String
Release notes for the project.
For example:
{
"packOptions": {
"releaseNotes": "Initial version, implemented flimflams."
}
}
iconUrl
Type: String
The URL for an icon that will be used in various places such as the package explorer.
For example:
{
"packOptions": {
"iconUrl": "http://www.mylibrary.gov/favicon.ico"
}
}
projectUrl
Type: String
The URL for the homepage of the project.
For example:
{
"packOptions": {
"projectUrl": "http://www.mylibrary.gov"
}
}
licenseUrl
Type: String
The URL for the license the project uses.
For example:
{
"packOptions": {
"licenseUrl": "http://www.mylibrary.gov/licence"
}
}
requireLicenseAcceptance
Type: Boolean
true
to cause a prompt to accept the package license when installing the package to be shown; otherwise, false
. Only used for NuGet packages, ignored in other uses. The default is false
.
For example:
{
"packOptions": {
"requireLicenseAcceptance": true
}
}
repository
Type: Object
Contains information about the repository where the project is stored.
type
Type: String
Type of the repository. The default value is "git".
For example:
{
"packOptions": {
"repository": {
"type": "git"
}
}
}
url
Type: String
URL of the repository where the project is stored.
For example:
{
"packOptions": {
"repository": {
"url": "http://github.com/dotnet/corefx"
}
}
}
files
Type: Object
include
Type: String or String[] with a globbing pattern.
{
"include":["wwwroot", "Views"]
}
exclude
Type: String or String[] with a globbing pattern.
Specifies which files to exclude from the build.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
includeFiles
Type: String or String[] with a globbing pattern.
{
"includeFiles":[]
}
excludeFiles
Type: String or String[] with a globbing pattern.
{
"excludeFiles":[]
}
builtIns
Type: Object
{
"builtIns":{}
}
mappings
Type: Object
Keys to the object represent destination paths in the output layout.
Values are either a string or an object representing the source path of files to include. The object representation can have its own include
, exclude
, includeFiles
and excludeFiles
sections.
String example:
{
"mappings": {
"dest/path": "./src/path"
}
}
Object example:
{
"mappings": {
"dest/path":{
"include":"./src/path"
}
}
}
analyzerOptions
Type: Object
An object with properties used by code analysers.
For example:
{
"analyzerOptions": { }
}
languageId
Type: String
The id of the language to analyze. "cs" represents C#, "vb" represents Visual Basic and "fs" represents F#.
For example:
"analyzerOptions": {
"languageId": "vb"
}
configurations
Type: Object
An object whose properties define different configurations for this project, such as Debug and Release. Each value is an object that can contain a buildOptions
object with options specific for this configuration.
For example:
"configurations": {
"Release": {
"buildOptions": {
"allowUnsafe": false
}
}
}
frameworks
Type: Object
Specifies which frameworks this project supports, such as the .NET Framework or Universal Windows Platform (UWP). Must be a valid Target Framework Moniker (TFM). Each value is an object that can contain information specific to this framework such as buildOptions
, analyzerOptions
, dependencies
as well as the properties in the following sections.
For example:
"frameworks": {
"netcoreapp1.0": {
"buildOptions": {
"define": ["FOO", "BIZ"]
}
}
}
dependencies
Type: Object
Dependencies that are specific for this framework. This is useful in scenarios where you cannot simply specify a package-level dependency across all targets. Reasons for this can include one target lacking built-in support that other targets have, or requiring a different version of a dependency than other targets. To see a list of the other properties for this node, see the earlier dependencies section.
For example:
"frameworks": {
"netstandard1.5": {
"dependencies": {
"Microsoft.Extensions.JsonParser.Sources": "1.0.0-rc2-20221"
}
}
}
frameworkAssemblies
Type: Object
Similar to dependencies but contains reference to assemblies in the GAC that are not NuGet packages. Can also specify the version to use as well as the dependency type. This is used when targeting .NET Framework and Portable Class Library (PCL) targets. You can only build a project with this specified on Windows.
For example:
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Runtime": {
"type": "build",
"version": "4.0.0"
}
}
}
}
wrappedProject
Type: String
Specifies the location of the dependency project.
For example:
"frameworks": {
"net451": {
"wrappedProject": "MyProject.csproj"
}
}
bin
Type: Object
This is used wrap a DLL file. You can reference and generate a package containing this DLL.
It contains a single String property, assembly
, whose value is the assembly path.
For example:
"frameworks": {
"netcoreapp1.0": {
"bin": {
"assembly": "c:/otherProject/otherdll.dll"
}
}
}
runtimes
Type: Object
List of runtime identifiers (RIDs) supported by the project (used when publishing self-contained deployments).
For example:
"runtimes": {
"win7-x64": {},
"win8-x64": {},
"win81-x64": {},
"win10-x64": {},
"osx.10.11-x64": {},
"ubuntu.16.04-x64": {}
}
userSecretsId
Type: String
Specifies a user secret identifier to be used at development-time. For more information, see Safe storage of app secrets during development.
For example:
{
"userSecretsId": "aspnet-WebApp1-c23d27a4-eb88-4b18-9b77-2a93f3b15119"
}
[asp.net core]project.json(2)的更多相关文章
- [asp.net core]project.json(1)
摘要 前面介绍了使用vs2015新建asp.net core web的内容,这篇文章学习下project.json文件的内容. project.json 原文:https://docs.microso ...
- ASP.NET Core的配置(5):配置的同步[ 实例篇]
ConfigurationBuilder在生成以Configuration对象的时候会利用注册其中的ConfigurationProvider加载原始的配置数据,那么一旦配置源中的数据发生变化,应用程 ...
- ASP.NET Core的配置(4):多样性的配置来源[下篇]
我们在上篇和中篇对配置模型中默认提供的各种ConfigurationProvider进行了深入详尽的介绍,如果它们依然不能满足项目中的配置需求,我们可以还可以通过自定义ConfigurationPro ...
- ASP.NET Core的配置(3): 将配置绑定为对象[上篇]
出于编程上的便利,我们通常不会直接利用ConfigurationBuilder创建的Configuration对象读取某个单一配置项的值,而是倾向于将一组相关的配置绑定为一个对象,我们将后者称为Opt ...
- ASP.NET Core的配置(1):读取配置信息
提到"配置"二字,我想绝大部分.NET开发人员脑海中会立马浮现出两个特殊文件的身影,那就是我们再熟悉不过的app.config和web.config,多年以来我们已经习惯了将结构化 ...
- ASP.NET Core的配置(5):配置的同步[设计篇]
本节所谓的"配置同步"主要体现在两个方面:其一,如何监控配置源并在其变化的时候自动加载其数据,其目的是让应用中通过Configuration对象承载的配置与配置源的数据同步:其二. ...
- ASP.NET Core的配置(4):多样性的配置来源[中篇]
我们在本篇文章中会介绍三种针对物理文件的ConfiguationProvider,它们分别是针对JSON文件的JsonConfiguationProvider,针对XML文件的XmlConfiguat ...
- ASP.NET Core的配置(4):多样性的配置来源[上篇]
较之传统通过App.config和Web.config这两个XML文件承载的配置系统,ASP.NET Core采用的这个全新的配置模型的最大一个优势就是针对多种不同配置源的支持.我们可以将内存变量.命 ...
- ASP.NET Core的配置(2):配置模型详解
在上面一章我们以实例演示的方式介绍了几种读取配置的几种方式,其中涉及到三个重要的对象,它们分别是承载结构化配置信息的Configuration,提供原始配置源数据的ConfigurationProvi ...
随机推荐
- js-FCC算法-Pairwise
找到你的另一半 都说优秀的程序员擅长面向对象编程,但却经常找不到另一半,这是为什么呢?因为你总是把自己局限成为一个程序员,没有打开自己的思维. 这是一个社群的时代啊,在这里你应该找到与你有相同价值观但 ...
- 【BZOJ-2251】外星联络 后缀数组 + 暴力
2251: [2010Beijing Wc]外星联络 Time Limit: 30 Sec Memory Limit: 256 MBSubmit: 670 Solved: 392[Submit][ ...
- git命令的使用 【备用】
*下面为对本地仓库进行操作 [将文件提交到本地仓库] git add 文件名 将文件添加到暂存区 git status ...
- bash 操作 sqlite3
首先,这是个奇怪的需求...但是遇到了.我参考后文链接里的方法,做了自己的. 表是自己手动建的,数据库名字叫 new.db: create table test (sn varchar(), name ...
- 数据结构算法C语言实现(五)---2.3重新定义线性链表及其基本操作
一.简述 ...由于链表在空间的合理利用上和插入.删除时不需要移动等的优点,因此在很多场合下,它是线性表的首选存储结构.然而,它也存在着实现某些基本操作,如求线性表的长度时不如顺序存储结构的缺点:另一 ...
- iOS评分(给个好评)
id 721996244 可以测试 NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app ...
- PL/0编译器(java version) – Scanner.java
1: package compiler; 2: 3: import java.io.BufferedReader; 4: import java.io.FileNotFoundException; ...
- virtualenv中ImportError: No module named django
问题现象:在代码py文件中,import django 报错,但是在python shell中直接执行这个语句没错, 网上搜索了下,自己测试了下,确定原因是由于使用了python中的virtualen ...
- CSS-论css如何纯代码实现内凹圆角
background-image: radial-gradient(200px at 50px 0px, #fff 50px, #4169E1 50px); 这是做内凹圆角的核心代码,就是背景图的ra ...
- 使用Keil uVision下载hex文件
在uVision3/uVision4/uVision5中,可以创建一个项目用来下载HEX文件到flash里面. 具体步骤如下: 1. 在菜单中,选择 Project - New Project... ...