dotnet build

dotnet build --help

eg@debian:~/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.ConsoleApp1$ dotnet build --help
Description:
  .NET Builder

Usage:
  dotnet build [<PROJECT | SOLUTION>...] [options]

Arguments:
  <PROJECT | SOLUTION>  The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.

Options:
  --ucr, --use-current-runtime         Use current runtime as the target runtime.
  -f, --framework <FRAMEWORK>          The target framework to build for. The target framework must also be specified in the project file.
  -c, --configuration <CONFIGURATION>  The configuration to use for building the project. The default for most projects is 'Debug'.
  -r, --runtime <RUNTIME_IDENTIFIER>   The target runtime to build for.
  --version-suffix <VERSION_SUFFIX>    Set the value of the $(VersionSuffix) property to use when building the project.
  --no-restore                         Do not restore the project before building.
  --interactive                        Allows the command to stop and wait for user input or action (for example to complete authentication).
  -v, --verbosity <LEVEL>              Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
  --debug
  -o, --output <OUTPUT_DIR>            The output directory to place built artifacts in.
  --no-incremental                     Do not use incremental building.
  --no-dependencies                    Do not build project-to-project references and only build the specified project.
  --nologo                             Do not display the startup banner or the copyright message.
  --sc, --self-contained               Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine.
                                       The default is 'true' if a runtime identifier is specified.
  --no-self-contained                  Publish your application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run your 
                                       application.
  -a, --arch <arch>                    The target architecture.
  --os <os>                            The target operating system.
  --disable-build-servers              Force the command to ignore any persistent build servers.
  -?, -h, --help                       Show command line help.

dotnet build <project_file_path> --self-contained --configuration <configuration_option>

eg@debian:~$ dotnet build ./Data/DotnetCliExamples/ExampleSolution/ExampleSolution.ConsoleApp1/ExampleSolution.ConsoleApp1.csproj --self-contained --configuration Release
MSBuild version 17.6.8+c70978d4d for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  ExampleSolution.ConsoleApp1 -> /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.ConsoleApp1/bin/Release/net7.0/linux-x64/ExampleSolution.ConsoleApp1.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.84

Last updated