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

.NET SDK Installation and Setup in C Sharp (C#) - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of .NET SDK Setup
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:30remaining
Output of .NET SDK Version Check Command
What is the output of running the command dotnet --version after installing the .NET SDK version 7.0.100?
AMicrosoft .NET SDK 7.0.100
Bdotnet version 7.0.100
C7.0.100
DError: command not found
Attempts:
2 left
💡 Hint
The dotnet --version command prints only the version number of the installed SDK.
🧠 Conceptual
intermediate
1:30remaining
Understanding .NET SDK and Runtime Relationship
Which statement correctly describes the relationship between the .NET SDK and the .NET Runtime?
AThe .NET SDK includes the .NET Runtime and tools needed to build and run applications.
BThe .NET Runtime includes the SDK and is used only for building applications.
CThe SDK and Runtime are completely separate and must be installed independently for any .NET app.
DThe SDK is only needed to run applications, while the Runtime is for development.
Attempts:
2 left
💡 Hint
Think about what you need to build and run apps versus just running them.
🔧 Debug
advanced
2:00remaining
Diagnosing .NET SDK Not Found Error
You installed the .NET SDK on Windows but running dotnet --version returns 'dotnet: command not found'. What is the most likely cause?
AThe .NET SDK installer failed to complete the installation.
BThe PATH environment variable does not include the folder where dotnet.exe is installed.
CThe .NET Runtime is missing but the SDK is installed correctly.
DThe dotnet command requires administrator privileges to run.
Attempts:
2 left
💡 Hint
Check if the system knows where to find the dotnet command.
📝 Syntax
advanced
1:30remaining
Correct Command to Install a Specific .NET SDK Version
Which command correctly installs .NET SDK version 6.0.400 using the dotnet-install script on Linux?
Abash dotnet-install.sh --version 6.0.400
Bbash install-dotnet.sh -v 6.0.400
Cinstall-dotnet --version=6.0.400
Ddotnet-install.sh --install 6.0.400
Attempts:
2 left
💡 Hint
The official script uses the --version option with the bash command.
🚀 Application
expert
2:30remaining
Determining Installed .NET SDKs Programmatically
You want to write a C# program that lists all installed .NET SDK versions on the machine. Which approach will reliably get this information?
ACheck the <code>Program Files/dotnet/sdk</code> directory for installed SDK folders.
BRead the registry keys under <code>HKEY_LOCAL_MACHINE\SOFTWARE\dotnet\Setup\InstalledVersions</code> on Windows only.
CUse the <code>System.Environment.Version</code> property in C# to get all installed SDK versions.
DRun the command <code>dotnet --list-sdks</code> from the program and parse its output.
Attempts:
2 left
💡 Hint
Think about a cross-platform way to get all SDK versions from the official tool.