Редактиране

Споделяне чрез


dotnet store

This article applies to: ✔️ .NET Core 3.1 SDK and later versions

Name

dotnet store - Stores the specified assemblies in the runtime package store.

Synopsis

dotnet store -m|--manifest <PATH_TO_MANIFEST_FILE>
    -f|--framework <FRAMEWORK_VERSION> -r|--runtime <RUNTIME_IDENTIFIER>
    [--framework-version <FRAMEWORK_VERSION>] [--output <OUTPUT_DIRECTORY>]
    [--skip-optimization] [--skip-symbols] [-v|--verbosity <LEVEL>]
    [--working-dir <WORKING_DIRECTORY>]

dotnet store -h|--help

Description

dotnet store stores the specified assemblies in the runtime package store. By default, assemblies are optimized for the target runtime and framework. For more information, see the runtime package store topic.

Required options

  • -f|--framework <FRAMEWORK>

    Specifies the target framework. The target framework has to be specified in the project file.

  • -m|--manifest <PATH_TO_MANIFEST_FILE>

    The package store manifest file is an XML file that contains the list of packages to store. The format of the manifest file is compatible with the SDK-style project format. So, a project file that references the desired packages can be used with the -m|--manifest option to store assemblies in the runtime package store. To specify multiple manifest files, repeat the option and path for each file. For example: --manifest packages1.csproj --manifest packages2.csproj.

  • -r|--runtime <RUNTIME_IDENTIFIER>

    The runtime identifier to target.

Optional options

  • --framework-version <FRAMEWORK_VERSION>

    Specifies the .NET SDK version. This option enables you to select a specific framework version beyond the framework specified by the -f|--framework option.

  • -?|-h|--help

    Prints out a description of how to use the command.

  • -o|--output <OUTPUT_DIRECTORY>

    Specifies the path to the runtime package store. If not specified, it defaults to the store subdirectory of the user profile .NET installation directory.

  • --skip-optimization

    Skips the optimization phase. For more information about optimization, see Preparing a runtime environment.

  • --skip-symbols

    Skips symbol generation. Currently, you can only generate symbols on Windows and Linux.

  • -v|--verbosity <LEVEL>

    Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. For more information, see LoggerVerbosity.

  • -w|--working-dir <WORKING_DIRECTORY>

    The working directory used by the command. If not specified, it uses the obj subdirectory of the current directory.

Examples

  • Store the packages specified in the packages.csproj project file for .NET 6.0.1:

    dotnet store --manifest packages.csproj --framework-version 6.0.1 --framework net6.0 --runtime win-x64
    
  • Store the packages specified in the packages.csproj without optimization:

    dotnet store --manifest packages.csproj --skip-optimization --framework net6.0 --runtime linux-x64
    

See also