पाठ 3 / 26

प्रोजेक्ट फ़ोल्डर के अंदर

.csproj और Program.cs पढ़ना सीखें और जानें कि bin व obj में क्या होता है।

.csproj फ़ाइल

.csproj एक छोटी XML फ़ाइल है जो प्रोजेक्ट बताती है: target framework, output type और NuGet packages। Source files आम तौर पर लिखनी नहीं पड़तीं; फ़ोल्डर की हर फ़ाइल शामिल होती है।

न्यूनतम प्रोजेक्ट फ़ाइल

Nullable null-safety warnings चालू करता है और ImplicitUsings आपके लिए आम using lines जोड़ देता है।

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
</Project>

bin और obj commit न करें

bin/ में build output और obj/ में intermediate files रहती हैं। दोनों फिर से बन जाती हैं, इसलिए .gitignore में डालें। dotnet new gitignore तैयार फ़ाइल बना देता है।

त्वरित जाँच: obj फ़ोल्डर में क्या होता है?

  • आपका हाथ से लिखा source code
  • Intermediate build files
  • User settings के secrets
  • Database migrations
Answer

Intermediate build files — इसमें generated intermediate files और restore results होते हैं; इन्हें हटाकर दोबारा बनाया जा सकता है।