You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

2 D铆as
21 Hrs
9 Min
40 Seg

dotnet CLI

13/21
Resources

What is the .NET CLI and how can it simplify your development?

The .NET CLI (Common Language Interface) is a powerful tool that allows you to compile, run and publish .NET projects, compatible with any type of .NET project. In addition, its command line interface provides accessibility to a number of advanced functions that could be complex if performed manually. Learn how to take full advantage of this tool to streamline your workflow and increase efficiency in your development projects.

What are the essential commands of the .NET CLI?

The .NET CLI is divided into two main groups of commands: general and project-specific:

  • General commands: these apply at the operating system and SDK level, allowing you to create new projects, structure folders, and manage configuration files. Examples include dotnet new, which generates a new project with a base template, and dotnet add, which manages packages and project references.

  • Project-specific commands: These must be run within a directory containing a .NET project, and are geared toward tasks such as restoring, compiling, running, cleaning up, and testing existing projects. Commands such as dotnet build compile the project, while dotnet run ex ecutes it.

How to run the .NET CLI on your operating system?

To use the .NET CLI, simply open a terminal on your operating system, be it Mac, Linux or Windows. A common initial step is to try the dotnet command, which confirms if the installation is correct by displaying the base instructions for using the CLI. If an error occurs or the command is not recognized, you may need to reinstall the .NET SDK.

Example of useful commands:

# Show help on commands available in .NET CLIdotnet help
 # Check the current version of the SDK in usedotnet --version
 # Show detailed information about installed SDK versionsdotnet --info
 # Create a new .NET project with a specific templatedotnet new <template>.

How to choose the right template for your .NET project?

The dotnet new command offers several templates for creating projects, depending on the type of application you want to develop:

  • ASP.NET Core Web App: Ideal for creating Web sites with ASP.NET.
  • Blazor Server: Perfect for web projects focused on WebAssembly.
  • ClassLibrary: Used to share functionalities between different projects.
  • ConsoleApp: Console application projects.
  • WinForm and WPF Application: For developing desktop applications with rich interfaces.

Example of dotnet new command usage:

# Create a new ASP.NET Core web applicationdotnet new webapp -n MyWebApplication
 # Start a Blazor Server projectdotnet new blazorserver -n MyBlazorApp.

With this command-line tool and its ability to handle a diversity of platforms and project types, the .NET CLI is indispensable in any .NET developer's toolkit. As you explore and master more commands, you will be able to optimize your workflow, improve your skills, and carry out projects more efficiently. Keep exploring and expanding your knowledge in the exciting world of .NET!

Contributions 12

Questions 4

Sort by:

Want to see more contributions, questions and answers from the community?

Hubo un error en el slide ya que CLI para este caso es Command-line interface.

https://es.wikipedia.org/wiki/Interfaz_de_l铆nea_de_comandos

Mis notitas de clase:

Por si a alguien no le funcione dotnet --version
solucione de esta forma, por si a alguien le pasa con la version 6.0.400

Basicamente fue eliminar la carpeta dotnet generada en el Archivos de Programa(x86)

https://stackoverflow.com/questions/73247933/how-to-fix-no-net-sdks-were-found-error-vscode

Comandos de esta clase

dotnet
dotnet --help
dotnet --version
dotnet --info
dotnet new

Para visualizar la versi贸n en macOS

dotnet --list-sdks

probando que el comando funcione como dijo el profesor

Todo funcionando, ahora a crear la APP.

dotnet --version
6.0.202

Comprobante dotnet y versi贸n. Adem谩s, s铆 tienes instalada una versi贸n reciente de visual studio, no necesitas descargar e instalar el .net

En una venta de consola (cmd), puedes ejecutar el dotnet --info

De tanto usar Language se le pego al profesor hahahaha.

CLR, CLS.

Pense que con instalar visual tenia el .net , pero no x_x

Examinando que todo este funcionando

Mi version de dotnet