← Back to C# Course | Chapter 1: Setup & Basics | Lesson 4 of 7

dotnet CLI परिचय

dotnet command एक helper है जिससे आप terminal में बात करते हैं जो नए projects शुरू, build, और run कर सकता है। यह एक butler जैसा है जो आपके ideas पर ध्यान देते हुए setup के काम करता है।

In this page:

  1. The dotnet CLI
Syntax
csharp
dotnet new console -n ProjectName   // create a project
dotnet build                        // compile
dotnet run                          // build and run

The dotnet CLI

dotnet command-line tool बिना किसी IDE के C# projects बनाता, build करता, और चलाता है।

dotnet new console एक चलने योग्य console project scaffold करता है, dotnet build इसे compile करता है, और dotnet run इसे एक step में build और execute करता है। यह tool किसी भी platform पर .NET development का standard entry point है।

Note: अगर पिछले build के बाद से source files बदल गई हों तो dotnet run अपने आप फिर से build करता है।

उदाहरण: The dotnet CLI

bash
# Create a new console project in the current folder
dotnet new console -o HelloApp
cd HelloApp

# Build without running
dotnet build

# Build and run in one step
dotnet run

⚠️ Run this in your own terminal or Node.js environment.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. किसी project file के बिना folder से dotnet run चलाना, जो कोई project न मिलने की error देता है।
  2. dotnet build (compile करता है) को dotnet run (build और run करता है) के साथ confuse करना।
  3. किसी दूसरे project के folder के अंदर एक project बनाना, जो build को गलत files उठाने पर मजबूर कर सकता है।
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.