0
0
C Sharp (C#)programming~5 mins

Project structure and csproj file in C Sharp (C#) - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a .csproj file in a C# project?
A .csproj file is an XML file that defines the project settings, files included, dependencies, and build instructions for a C# project.
Click to reveal answer
beginner
Name two main folders you often find in a typical C# project structure.
Common folders are Properties (for project settings) and bin (for compiled output).
Click to reveal answer
intermediate
What does the <ItemGroup> element in a .csproj file do?
It groups items like source files, references, or resources that the project uses or includes.
Click to reveal answer
beginner
How does the .csproj file help when you add a new C# source file to your project?
The .csproj file lists the new source file so the compiler knows to include it when building the project.
Click to reveal answer
intermediate
What is the purpose of the <PropertyGroup> in a .csproj file?
It defines project-wide settings like target framework, output type, and version information.
Click to reveal answer
What file extension does a C# project file use?
A.csproj
B.csharp
C.projcs
D.csfile
Which XML element in a .csproj file lists the source code files?
A&lt;PropertyGroup&gt;
B&lt;Compile&gt;
C&lt;Reference&gt;
D&lt;ItemGroup&gt;
Where are the compiled files usually stored in a C# project?
Aobj/
Bbin/
Csrc/
Dlib/
What does the <TargetFramework> tag specify in a .csproj file?
AThe .NET version to build against
BThe output file name
CThe list of source files
DThe programming language version
If you want to add a NuGet package to your project, which file do you update?
AProgram.cs
Bapp.config
C.csproj file
Dpackages.config
Explain the role of the .csproj file in managing a C# project.
Think about how the project knows what to build and how.
You got /4 concepts.
    Describe a typical folder structure you might see in a C# project and what each folder contains.
    Consider where you write code and where the computer puts the results.
    You got /4 concepts.