| title | project.json reference |
|---|---|
| description | project.json reference |
| keywords | .NET, .NET Core |
| author | aL3891 |
| manager | wpickett |
| ms.date | 06/20/2016 |
| ms.topic | article |
| ms.prod | .net-core |
| ms.technology | .net-core-technologies |
| ms.devlang | dotnet |
| ms.assetid | 3aef32bd-ee2a-4e24-80f8-a2b615e0336d |
Note
This topic is likely to change before release! You can track the status of this issue through our public GitHub issue tracker.
- name
- version
- summary
- description
- copyright
- title
- entryPoint
- projectUrl
- licenseUrl
- iconUrl
- compilerName
- testRunner
- authors
- owners
- tags
- language
- releaseNotes
- requireLicenseAcceptance
- embedInteropTypes
- compile
- content
- resource
- preprocess
- publishExclude
- shared
- namedResource
- packInclude
- exclude
- contentBuiltIn
- compileBuiltIn
- resourceBuiltIn
- excludeBuiltIn
- dependencies
- tools
- commands
- scripts
- compilationOptions
- analyzerOptions
- configurations
- frameworks
Type: String
The name of the project, used for the assembly name as well as the name of the package. The top level folder name is used if this property is not specified.
For example:
{
"name": "MyLibrary"
}
Type: String
The Semver version of the project, also used for the nuget package.
For example:
{
"version": "1.0.0-*"
}
Type: String
A short description of the project.
For example:
{
"summary": "This is my library."
}
Type: String
A longer description of the project. Used in the assembly properties.
For example:
{
"description": "This is my library and it's really great!"
}
Type: String
The copyright information for the project. Used in the assembly properties.
For example:
{
"copyright": "Fabrikam 2016"
}
Type: String
The friendly name of the project, can contain spaces and special characters not allowed when using the name property. Used in the assembly properties.
For example:
{
"title": "My Library"
}
Type: String
The entrypoint method for the project. Main by default.
For example:
{
"entryPoint": "ADifferentMethod"
}
Type: String
The url for the homepage of the project.
For example:
{
"projectUrl": "http://www.mylibrary.gov"
}
Type: String
The url for the licence the project uses.
For example:
{
"licenseUrl": "http://www.mylibrary.gov/licence"
}
Type: String
The url for an icon that will be used in various places such as the package explorer.
For example:
{
"iconUrl": "http://www.mylibrary.gov/favicon.ico"
}
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"
}
Type: String
The name of the testrunner, such as NUnit or xUnit, to use with this project, setting this also marks the project as a test project.
For example:
{
"testRunner": "NUnit"
}
Type: String[]
An array of strings with the names of the authors of the project.
For example:
{
"authors": ["Anne", "Bob"]
}
Type: String[]
An array of strings with the names of the owners of the project.
For example:
{
"owners": ["Fabrikam", "Microsoft"]
}
Type: String[]
An array of strings with tags for the project, used for searching in NuGet.
For example:
{
"tags": ["hyperscale", "cats"]
}
Type: String
The (human) language of the project, corresponds to the "neutral-language" compiler argument.
For example:
{
"language": "en-US"
}
Type: String
Release notes for the project.
For example:
{
"releaseNotes": "Initial version, implemented flimflams."
}
Type: Boolean
A boolean that causes a prompt to accept the package license when installing the package to be shown. Only used for nuget packages, ignored in other uses.
For example:
{
"requireLicenseAcceptance": true
}
Type: Boolean
If set to true, embeds COM interop types in the assembly.
For example:
{
"embedInteropTypes": true
}
Type: String or String[] with a globbing pattern
Specifies what files are included in compilation.
For example:
{
"compile": "**/*.cs"
}
Type: String or String[] with a globbing pattern
Specifies what files are included in the build output, such as images or fonts.
For example:
{
"content": "content/*.jpg"
}
Type: String or String[] with a globbing pattern
Specifies resource files for the project.
For example:
{
"resource": [ "compiler/resources/**/*", "**/*.resx" ]
}
Type: String or String[] with a globbing pattern
Specifies what files are included in preprocessing.
For example:
{
"preprocess": "compiler/preprocess/**/*.cs"
}
Type: String or String[] with a globbing pattern
Specifies what files are excluded from publishing.
For example:
{
"publishExclude": "**/*.pdb"
}
Type: String or String[] with a globbing pattern
Specifies what files are shared, this is used for library export.
For example:
{
"shared": "shared/**/*.cs"
}
Type: Object
An object whose properties are names of named resources.
For example:
{
"namedResource": {
"MyString" : "Hello there!"
}
}
Type: String or String[] with a globbing pattern
Specifies what files are included when creating the NuGet package.
For example:
{
"packInclude": "myDeploymentScripts/**/*.ps1"
}
Type: String or String[] with a globbing pattern
Specifies what files to exclude from the build.
For example:
{
"exclude": ["bin/**", "obj/**"]
}
Type: String or String[] with a globbing pattern
Specifies what files are considerd content by the build.
For example:
{
"contentBuiltIn": "content/*.jpg"
}
Type: String or String[] with a globbing pattern
Specifies what files are included in compilation.
For example:
{
"compileBuiltIn": "**/*.cs"
}
Type: String or String[] with a globbing pattern
Specifies resource files for the project.
For example:
{
"resourceBuiltIn": [ "compiler/resources/**/*", "**/*.resx" ]
}
Type: String or String[] with a globbing pattern
Specifies what files to exclude from the build.
For example:
{
"excludeBuiltIn": ["bin/**", "obj/**"]
}
Type: Object
An object that defines the package dependencies of the project, each key of this object is the name of a package and each value contains versioning information.
For example:
"dependencies": {
"System.Reflection.Metadata": "1.2.0-rc3-23811",
"Microsoft.Extensions.JsonParser.Sources": {
"type": "build",
"version": "1.0.0"
},
"Microsoft.Extensions.HashCodeCombiner.Sources": {
"type": "build",
"version": "1.0.0"
},
"Microsoft.Extensions.DependencyModel": "1.0.0-*"
}
Type: Object
An object that defines package dependencies that are used as tools for the current project, not as references. Packages defined here are available in scripts that run during the build process, but they are not accessible to the code in the project itself. Tools can for example include code generators or post-build tools that perform tasks related to packing.
For example:
{
"tools": {
"MyObfuscator": "1.2.4"
}
}
Type: Object
TODO: Investigate actual status
Commands are deprecated in the cli. (?)
Type: Object
An object that defines scripts run during the build proces. each key in this object identifies where in the build the script is run, each value is either a string with the script to run or an array of strings containg scripts that will run in order. The supported events are:
- precompile
- postcompile
- prepublish
- postpublish
For example:
{
"scripts": {
"precompile": "generateCode.cmd"
"postcompile": [ "obfuscate.cmd", "removeTempFiles.cmd" ]
}
}
Type: Object
An object whose properties control various aspects of compilation, the valid properties are listed below. Can also be specified per target framework as described in the frameworks section
For example:
"compilationOptions": {
"allowUnsafe": true
}
Type: String[]
A list of defines such as "DEBUG" or "TRACE" that can be used in conditional compilation in the code.
For example:
{
"compilationOptions": {
"define": ["TEST", "OTHERCONDITION"]
}
}
Type: String[]
A list of warnings to ignore.
For example:
{
"compilationOptions": {
"nowarn": ["CS0168", "CS0219"]
}
}
This ignores the warnings The variable 'var' is assigned but its value is never used and The variable 'var' is assigned but its value is never used
Type: String[]
A list of extra arguments that will be passed to the compiler.
For example:
{
"compilationOptions": {
"additionalArguments": ["/parallel", "/nostdlib"]
}
}
Type: String
The version of the language used by the compiler: ISO-1, ISO-2, 3, 4, 5, 6, or Default
For example:
{
"compilationOptions": {
"languageVersion": "5"
}
}
Type: Boolean
Allows unsafe code in this project.
For example:
{
"compilationOptions": {
"allowUnsafe": true
}
}
Type: String
The name of the target platform, such as AnyCpu, x86 or x64.
For example:
{
"compilationOptions": {
"platform": "x64"
}
}
Type: Boolean
If set to true, treats warnings as errors.
For example:
{
"compilationOptions": {
"warningsAsErrors": true
}
}
Type: Boolean
Enables the compiler to optimize the code in this project.
For example:
{
"compilationOptions": {
"optimize": true
}
}
Type: String
The path for the key file used for signing this assembly.
For example:
{
"compilationOptions": {
"keyFile": "../keyfile.snk"
}
}
Type: Boolean
Causes signing to be delayed.
For example:
{
"compilationOptions": {
"delaySign": true
}
}
Type: Boolean
Enables signing of the resulting assembly.
For example:
{
"compilationOptions": {
"publicSign": true
}
}
Type: Boolean
Creates an executable if set to true, otherwise the project will produce a .dll.
For example:
{
"compilationOptions": {
"emitEntryPoint": true
}
}
Type: Boolean
Enables xml docs to be generated from comments in the source code.
For example:
{
"compilationOptions": {
"xmlDoc": true
}
}
Type: Boolean
TODO
Type: Object
An object with properties used by code analysers.
For example:
{
"analyzerOptions": { }
}
Type: String
TODO: Check language ids The id of the language to analyze.
For example:
"analyzerOptions": {
"languageId": "vb"
}
}
Type: Object
An object whos properties define different configurations for this project, such as Debug and Release. Each value is an object that can contain a compilationOptions object with options specific for this coniguration.
For example:
"configurations": {
"Release": {
"compilationOptions": {
"allowUnsafe": false
}
}
}
Type: Object
Specifies what frameworks this project supports, such as .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 compilationoptions, analyzerOptions, dependencies as well as the properties in the following sections.
For example:
"frameworks": {
"dnxcore50": {
"compilationoptions": {
"define": ["FOO", "BIZ"]
}
}
}
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.
For example:
"frameworks": {
"dnxcore50": {
"dependencies": {
"Microsoft.Extensions.JsonParser.Sources": "1.0.0"
}
}
}
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"
}
}
}
Type: String
TODO
Type: Object
An object with a single property, assembly, whose value is the assembly path.
For example:
"frameworks": {
"dnxcore50": {
"bin": {
"assembly" :"c:/otherProject/otherdll.dll"
}
}
}
Type: String
TODO Specifies other framework profiles that this project is compatible with.
For example:
"frameworks": {
"dnxcore50": {
"imports": "portable-net45+win8"
}
}
Will cause other packages targeting portable-net45+win8 to be usable when targeting dnxcore50 with the current project