当前位置: 首页 > news >正文

[asp.net core]project.json(2)

摘要

上篇文章介绍了project.json中的一部分属性。属性真的比较多,所以分开了,考虑到其中的英文比较简单,也不再进行翻译了,从英文原文中,直接粘贴过来了。

project.json(1)

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": 4
        }
    }
}

System.Threading.ThreadPool.MaxThreads

Type: Integer

Overrides the number of maximum threads for the ThreadPool worker pool.

{
    "runtimeOptions": {
        "configProperties": {
            "System.Threading.ThreadPool.MaxThreads": 25
        }
    }
}

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"
}

转载于:https://www.cnblogs.com/wolf-sun/p/5989076.html

相关文章:

  • Java 8中,Function,Consumer,Predicate,Supplier举例 ,以及CompletableFuture使用
  • dict 没有 key 的情况
  • linux装oracle客户端
  • 聊聊自己的职业规划这个件事
  • 阿里云ECS Centos7 系统安装图形化桌面
  • iOS scrollView 的相关使用
  • 经典Java面试题-内部类
  • Android只需两步,使你的Android Studio支持Lambda表达式
  • 【Android】Android开发实现进度条效果,SeekBar的简单使用。音量,音乐播放进度,视频播放进度等...
  • 移动webapp前端ui用哪个框架好
  • 理解 iOS 的内存管理
  • 绘制动画及动画循环练习
  • Sublime插件支持Sass编译和Babel解析ES6 .sublime-build文件初探
  • SCCM 2016 + SQL 2016 + Win 2012 R2 安装教程
  • lduan server 2012证书服务角色分离(十七)
  • 【comparator, comparable】小总结
  • 【腾讯Bugly干货分享】从0到1打造直播 App
  • Java方法详解
  • magento2项目上线注意事项
  • MyEclipse 8.0 GA 搭建 Struts2 + Spring2 + Hibernate3 (测试)
  • vue-loader 源码解析系列之 selector
  • 分享几个不错的工具
  • 猴子数据域名防封接口降低小说被封的风险
  • 批量截取pdf文件
  • 为视图添加丝滑的水波纹
  • 赢得Docker挑战最佳实践
  • 在Mac OS X上安装 Ruby运行环境
  • 进程与线程(三)——进程/线程间通信
  • 选择阿里云数据库HBase版十大理由
  • 支付宝花15年解决的这个问题,顶得上做出十个支付宝 ...
  • ​LeetCode解法汇总2583. 二叉树中的第 K 大层和
  • ![CDATA[ ]] 是什么东东
  • # 日期待t_最值得等的SUV奥迪Q9:空间比MPV还大,或搭4.0T,香
  • #### go map 底层结构 ####
  • (2.2w字)前端单元测试之Jest详解篇
  • (7)STL算法之交换赋值
  • (六)什么是Vite——热更新时vite、webpack做了什么
  • (数位dp) 算法竞赛入门到进阶 书本题集
  • (一)搭建springboot+vue前后端分离项目--前端vue搭建
  • (转)用.Net的File控件上传文件的解决方案
  • (转载)从 Java 代码到 Java 堆
  • (转载)虚函数剖析
  • ... 是什么 ?... 有什么用处?
  • .NET CLR基本术语
  • .NET Core 版本不支持的问题
  • .NET Standard、.NET Framework 、.NET Core三者的关系与区别?
  • .NET Windows:删除文件夹后立即判断,有可能依然存在
  • .net 怎么循环得到数组里的值_关于js数组
  • .netcore 获取appsettings
  • .Net程序帮助文档制作
  • .NET性能优化(文摘)
  • .NET中GET与SET的用法
  • @AutoConfigurationPackage的使用
  • [145] 二叉树的后序遍历 js
  • [20161214]如何确定dbid.txt