Forrest logo
tool overview
On this page you find all important commands for the CLI tool dotnet. If the command you are looking for is missing please ask our AI.

dotnet

dotnet is a command line tool provided by Microsoft for managing and executing .NET applications and libraries. It is a cross-platform tool that can be used on Windows, macOS, and Linux operating systems.

With dotnet, developers can create, build, run, and publish .NET applications across different platforms. It supports multiple programming languages, including C#, F#, and Visual Basic.

Some common tasks that can be performed using dotnet include:

  1. Creating a new .NET project: You can use dotnet to create a new project template based on your desired programming language and project type.

  2. Building and compiling a .NET project: dotnet can compile and build your application, resolving dependencies and generating output binaries.

  3. Running and testing a .NET application: dotnet allows you to run and test your application locally, enabling quick iterations during development.

  4. Restoring and managing package dependencies: dotnet can restore and manage the required NuGet packages and their versions for your project.

  5. Publishing a .NET application: dotnet offers a publish command that allows you to create a self-contained package of your application, ready to be deployed and run on any machine without requiring the .NET SDK.

The dotnet tool provides a comprehensive set of options and commands to facilitate efficient .NET application development, deployment, and management. It plays a crucial role in the .NET development ecosystem and is widely used by developers to build various types of applications and libraries.

List of commands for dotnet:

  • dotnet-build:tldr:508c3 dotnet-build: Compile without restoring dependencies.
    $ dotnet build --no-restore
    try on your machine
    explain this command
  • dotnet-build:tldr:9e295 dotnet-build: Compile a .NET project or solution in debug mode.
    $ dotnet build ${path-to-project_or_solution}
    try on your machine
    explain this command
  • dotnet-build:tldr:d4612 dotnet-build: Compile with a specific verbosity level.
    $ dotnet build --verbosity ${select}
    try on your machine
    explain this command
  • dotnet-build:tldr:e834e dotnet-build: Compile the project or solution in the current directory.
    $ dotnet build
    try on your machine
    explain this command
  • dotnet-build:tldr:ecf3e dotnet-build: Specify the output directory.
    $ dotnet build --output ${path-to-directory}
    try on your machine
    explain this command
  • dotnet-build:tldr:f291f dotnet-build: Compile for a specific runtime.
    $ dotnet build --runtime ${runtime_identifier}
    try on your machine
    explain this command
  • dotnet-build:tldr:f34f3 dotnet-build: Compile in release mode.
    $ dotnet build --configuration ${Release}
    try on your machine
    explain this command
  • dotnet-ef:tldr:019e3 dotnet-ef: List available `DbContext` types.
    $ dotnet ef dbcontext list
    try on your machine
    explain this command
  • dotnet-ef:tldr:05498 dotnet-ef: Update the database to a specified migration.
    $ dotnet ef database update ${migration}
    try on your machine
    explain this command
  • dotnet-ef:tldr:26ec8 dotnet-ef: Add a new migration.
    $ dotnet ef migrations add ${name}
    try on your machine
    explain this command
  • dotnet-ef:tldr:5f081 dotnet-ef: Remove the last migration, rolling back the code changes that were done for the latest migration.
    $ dotnet ef migrations remove
    try on your machine
    explain this command
  • dotnet-ef:tldr:60d1e dotnet-ef: Generate a SQL script from migrations range.
    $ dotnet ef migrations script ${from_migration} ${to_migration}
    try on your machine
    explain this command
  • dotnet-ef:tldr:ca109 dotnet-ef: List available migrations.
    $ dotnet ef migrations list
    try on your machine
    explain this command
  • dotnet-ef:tldr:d0f69 dotnet-ef: Generate code for a `DbContext` and entity types for a database.
    $ dotnet ef dbcontext scaffold ${connection_string} ${provider}
    try on your machine
    explain this command
  • dotnet-ef:tldr:db9e7 dotnet-ef: Drop the database.
    $ dotnet ef database drop
    try on your machine
    explain this command
  • dotnet-publish:tldr:314f6 dotnet-publish: Specify the output directory.
    $ dotnet publish --output ${path-to-directory} ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-publish:tldr:39778 dotnet-publish: Trim unused libraries to reduce the deployment size of an application.
    $ dotnet publish --self-contained true --runtime ${runtime_identifier} -p:PublishTrimmed=true ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-publish:tldr:90e39 dotnet-publish: Publish the .NET Core runtime with your application for the specified runtime.
    $ dotnet publish --self-contained true --runtime ${runtime_identifier} ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-publish:tldr:a2d75 dotnet-publish: Compile a .NET project in release mode.
    $ dotnet publish --configuration Release ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-publish:tldr:c4820 dotnet-publish: Compile a .NET project without restoring dependencies.
    $ dotnet publish --no-restore ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-publish:tldr:f20c1 dotnet-publish: Package the application into a platform-specific single-file executable.
    $ dotnet publish --runtime ${runtime_identifier} -p:PublishSingleFile=true ${path-to-project_file}
    try on your machine
    explain this command
  • dotnet-restore:tldr:03ab0 dotnet-restore: Restore dependencies for a .NET project or solution in a specific location.
    $ dotnet restore ${path-to-project_or_solution}
    try on your machine
    explain this command
  • dotnet-restore:tldr:0d85e dotnet-restore: Restore dependencies using package source failures as warnings.
    $ dotnet restore --ignore-failed-sources
    try on your machine
    explain this command
  • dotnet-restore:tldr:46505 dotnet-restore: Restore dependencies with a specific verbosity level.
    $ dotnet restore --verbosity ${select}
    try on your machine
    explain this command
  • dotnet-restore:tldr:64022 dotnet-restore: Restore dependencies for a .NET project or solution in the current directory.
    $ dotnet restore
    try on your machine
    explain this command
  • dotnet-restore:tldr:78ae2 dotnet-restore: Restore dependencies without caching the HTTP requests.
    $ dotnet restore --no-cache
    try on your machine
    explain this command
  • dotnet-restore:tldr:e3467 dotnet-restore: Force all dependencies to be resolved even if the last restore was successful.
    $ dotnet restore --force
    try on your machine
    explain this command
  • dotnet-tool:tldr:1fb92 dotnet-tool: Update a specific global tool (don't use `--global` for local tools).
    $ dotnet tool update --global ${tool_name}
    try on your machine
    explain this command
  • dotnet-tool:tldr:23a5a dotnet-tool: Search tools in NuGet.
    $ dotnet tool search ${search_term}
    try on your machine
    explain this command
  • dotnet-tool:tldr:38e24 dotnet-tool: List installed global tools (don't use `--global` for local tools).
    $ dotnet tool list --global
    try on your machine
    explain this command
  • dotnet-tool:tldr:70531 dotnet-tool: Install a global tool (don't use `--global` for local tools).
    $ dotnet tool install --global ${dotnetsay}
    try on your machine
    explain this command
  • dotnet-tool:tldr:84e12 dotnet-tool: Display help.
    $ dotnet tool --help
    try on your machine
    explain this command
  • dotnet-tool:tldr:af465 dotnet-tool: Uninstall a global tool (don't use `--global` for local tools).
    $ dotnet tool uninstall --global ${tool_name}
    try on your machine
    explain this command
  • dotnet-tool:tldr:c61cf dotnet-tool: Install tools defined in the local tool manifest.
    $ dotnet tool restore
    try on your machine
    explain this command
  • dotnet:tldr:246ce dotnet: Build and execute the .NET project in the current directory.
    $ dotnet run
    try on your machine
    explain this command
  • dotnet:tldr:41f08 dotnet: Initialize a new .NET project.
    $ dotnet new ${template_short_name}
    try on your machine
    explain this command
  • dotnet:tldr:494e7 dotnet: Run a packaged dotnet application (only needs the runtime, the rest of the commands require the .NET Core SDK installed).
    $ dotnet ${path-to-application-dll}
    try on your machine
    explain this command
tool overview