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

Project structure and csproj file in C Sharp (C#) - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Project Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Understanding the default output path in a .csproj file
Given this snippet from a .csproj file:
<PropertyGroup>
  <OutputPath>bin\Debug\net7.0\</OutputPath>
</PropertyGroup>

What is the folder where the compiled DLL will be placed when building in Debug mode?
Aobj\Debug\net7.0\
Bbin\Release\net7.0\
Cbin\Debug\net7.0\
Dbin\Debug\
Attempts:
2 left
💡 Hint
Look at the OutputPath element and the build configuration.
Predict Output
intermediate
2:00remaining
Effect of TargetFramework in a .csproj file
What will be the target framework of the project given this .csproj snippet?
<PropertyGroup>
  <TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
A.NET Core 3.1
B.NET 6.0
C.NET 5.0
D.NET Framework 4.8
Attempts:
2 left
💡 Hint
The TargetFramework element specifies the version of .NET to target.
Predict Output
advanced
2:00remaining
Determining the number of project references
Given this .csproj snippet:
<ItemGroup>
  <ProjectReference Include="..\Library1\Library1.csproj" />
  <ProjectReference Include="..\Library2\Library2.csproj" />
</ItemGroup>

How many project references does this project have?
A3
B1
C0
D2
Attempts:
2 left
💡 Hint
Count the ProjectReference elements inside ItemGroup.
Predict Output
advanced
2:00remaining
Output type effect on build output
What will be the output file type if the .csproj file contains:
<PropertyGroup>
  <OutputType>Exe</OutputType>
</PropertyGroup>
AAn executable (.exe) file
BA dynamic link library (.dll) file
CA static library (.lib) file
DA script file (.csx)
Attempts:
2 left
💡 Hint
OutputType controls the kind of output assembly produced.
🧠 Conceptual
expert
3:00remaining
Understanding SDK attribute in .csproj
What is the purpose of the SDK attribute in the <Project> element of a .csproj file like:
<Project Sdk="Microsoft.NET.Sdk">
?
AIt specifies the set of build tools and targets to use for the project
BIt defines the output folder for the compiled binaries
CIt sets the target framework version for the project
DIt lists the NuGet packages to restore before building
Attempts:
2 left
💡 Hint
Think about what the SDK attribute controls in the build process.