2016-01-05 02:25:15 +00:00
% DOTNET-PUBLISH(1)
2016-04-15 17:36:31 +00:00
% Microsoft Corporation dotnetclifeedback@microsoft.com
% April 2016
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
## NAME
2015-11-16 14:37:00 +00:00
2016-01-05 02:25:15 +00:00
`dotnet-publish` - packs the application and all of its dependencies into a folder getting it ready for publishing
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
## SYNOPSIS
2015-11-16 14:37:00 +00:00
2016-01-05 02:25:15 +00:00
dotnet-publish [--framework]
2016-04-15 17:36:31 +00:00
[--runtime] [--build-base-path] [--output]
[--version-suffix] [--configuration]
2016-01-05 02:25:15 +00:00
[< project > ]
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
## DESCRIPTION
2016-05-13 21:51:38 +00:00
`dotnet-publish` builds the application, reads through its dependencies specified in `project.json` and publishes the resulting set of files to a directory.
2016-04-15 17:36:31 +00:00
Depending on the type of portable app, the directory contains the following:
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
1. **Portable application** - application's intermediate language (IL) code and all of application's managed dependencies.
* **Portable application with native dependencies** - as above with a sub-directory for each native dependencies'
supported platform.
2. **Self-contained application** - as above as well as the entire runtime for the targeted platform.
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
The above types are covered in more details in the [types of portable applications ](app-types.md ) document.
2015-12-02 22:37:37 +00:00
2016-04-15 17:36:31 +00:00
## OPTIONS
2015-12-21 20:23:46 +00:00
2016-01-05 02:25:15 +00:00
`[project]`
2016-04-15 17:36:31 +00:00
`dotnet-publish` needs access to `project.json` to work. If it is not specified on invocation via [project],
`project.json` in the current directory will be the default.
If no `project.json` can be found, `dotnet-publish` will error out.
2015-11-16 14:37:00 +00:00
2015-12-02 22:37:37 +00:00
`-f` , `--framework` [FID]
2016-04-15 17:36:31 +00:00
Publish the application for a given framework identifier (FID). If not specified, FID is read from `project.json` . In case of no valid framework found, the command will error out. In case of multiple valid frameworks found, the command will publish for all valid frameworks.
2016-01-05 02:25:15 +00:00
2015-12-02 22:37:37 +00:00
`-r` , `--runtime` [RID]
2016-04-15 17:36:31 +00:00
Publish the application for a given runtime.
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
`-b` , `--build-base-path` [DIR]
Directory in which to place temporary outputs
2015-11-16 14:37:00 +00:00
2015-12-02 22:37:37 +00:00
`-o` , `--output`
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
Specify the path where to place the directory. If not specified, will default to _./bin/[configuration]/[framework]/_
for portable applications. For self-contained applications, will default to _./bin/[configuration]/[framework]/[runtime]_
--version-suffix [VERSION_SUFFIX]
Defines what `*` should be replaced with in the version field in project.json.
2015-12-02 22:37:37 +00:00
`-c` , `--configuration [Debug|Release]`
2016-04-15 17:36:31 +00:00
Configuration to use when publishing. If not specified, will default to "Debug".
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
## EXAMPLES
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
`dotnet publish`
2016-01-05 02:25:15 +00:00
2016-04-15 17:36:31 +00:00
Publish an application using the framework found in `project.json` . If `project.json` contains `runtimes` node, publish
for the RID of the current platform.
2015-12-02 22:37:37 +00:00
2016-04-15 17:36:31 +00:00
`dotnet publish ~/projects/app1/project.json`
2016-01-05 02:25:15 +00:00
2016-04-15 17:36:31 +00:00
Publish the application using the specified `project.json` .
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
`dotnet publish --framework netcoreapp1.0`
2016-01-05 02:25:15 +00:00
2016-04-15 17:36:31 +00:00
Publish the current application using the `netcoreapp1.0` framework.
2015-11-16 14:37:00 +00:00
2016-04-15 17:36:31 +00:00
`dotnet publish --framework netcoreapp1.0 --runtime osx.10.11-x64`
2016-01-05 02:25:15 +00:00
2016-04-15 17:36:31 +00:00
Publish the current application using the `netcoreapp1.0` framework and runtime for `OS X 10.10` . This RID has to
exist in the `project.json` `runtimes` node.
2016-01-05 02:25:15 +00:00
2016-04-15 17:36:31 +00:00
## SEE ALSO
2015-12-02 22:37:37 +00:00
2016-05-13 21:51:38 +00:00
dotnet-restore(1), dotnet-build(1)