2015-11-16 14:37:00 +00:00
dotnet-publish
==============
**NAME**
2015-12-02 22:37:37 +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
**SYNOPSIS**
2015-12-02 22:37:37 +00:00
`dotnet-publish [options] [project]`
2015-11-16 14:37:00 +00:00
**DESCRIPTION**
2015-12-02 22:37:37 +00:00
`dotnet-publish` will compile the application, read through its dependencies specified in _project.json_ and publish the resulting set of files to a directory.
This directory contains the assemblies, the runtime as well as the runnable version of the application.
This directory can then be moved to a different machine and the application will be able to be ran regardless of existence of any other runtime.
2015-11-16 14:37:00 +00:00
2015-12-02 22:37:37 +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.
The command also requires information on the targeted framework and runtime, both of which can be specified on the command line.
If the runtime is not specified, the command will default to the runtime for the current operating system.
If the framework is not specified, the command will read the information from the _project.json_ file.
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.
2015-11-16 14:37:00 +00:00
**Options**
2015-12-02 22:37:37 +00:00
`-f` , `--framework` [FID]
Publish the application for a given framework identifier (FID).
If not specified, FID is read from _project.json_ .
`-r` , `--runtime` [RID]
Publish the application for a given runtime.
Supported values for runtimes at this time are:
2015-11-16 14:37:00 +00:00
2015-11-18 07:59:53 +00:00
* ubuntu.14.04-x64
* win7-x64
* osx.10.10-x64
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
2015-12-02 22:37:37 +00:00
Specify the path where to place the directory.
If not specified, will default to _./bin/[configuration]/[framework]/[runtime]/_
`-c` , `--configuration [Debug|Release]`
Configuration to use when publishing.
If not specified, will default to "Debug".
2015-11-16 14:37:00 +00:00
**EXAMPLES**
2015-12-02 22:37:37 +00:00
`dotnet-publish`
>Publish the current application using the _project.json_ framework and runtime for the current operating system.
`dotnet-publish ~/projects/app1/project.json`
>Publish the application using the specified _project.json_ ; also use framework specified withing and runtime for the current operating system.
2015-11-16 14:37:00 +00:00
2015-12-02 22:37:37 +00:00
`dotnet-publish --framework dnxcore50`
>Publish the current application using the `dnxcore50` framework and runtime for the current operating system.
2015-11-16 14:37:00 +00:00
2015-12-02 22:37:37 +00:00
`dotnet-publish --framework dnxcore50 --runtime osx.10.10-x64`
>Publish the current application using the `dnxcore50` framework and runtime for `OS X 10.10`
2015-11-16 14:37:00 +00:00
**SEE ALSO**
2015-12-02 22:37:37 +00:00
`dotnet-restore`