Cross-platform development with .NET Core enables developers to build applications that run on multiple platforms like Windows, Linux, and macOS. This chapter covers .NET Core’s features, cross-platform C# development, and deploying applications across different operating systems. Below are 30 multiple-choice questions (MCQs) on .NET Core, cross-platform development, and deployment processes.
1. Overview of .NET Core and .NET 5+
What is .NET Core primarily designed for?
A) Windows-only development
B) Cross-platform development
C) Mobile app development
D) Cloud computing
What is the key difference between .NET Core and the .NET Framework?
A) .NET Core is open-source and cross-platform
B) .NET Core is only for web applications
C) .NET Core is not supported on Windows
D) .NET Framework supports macOS
Which of the following is a feature of .NET 5+?
A) It is platform-specific
B) It combines .NET Core and .NET Framework
C) It only supports Windows
D) It requires separate runtime installations for each platform
Which version of .NET Core introduced significant cross-platform capabilities?
A) .NET Core 1.0
B) .NET Core 2.0
C) .NET Core 3.0
D) .NET Core 5.0
Which programming language can be used to develop applications in .NET Core?
A) Python
B) C#
C) JavaScript
D) Java
What is the purpose of the .NET SDK (Software Development Kit)?
A) To provide a runtime environment
B) To enable the compilation and execution of .NET applications
C) To provide cloud services
D) To manage databases
How do developers install .NET Core on different platforms?
A) Through a package manager or installer for each OS
B) By downloading .NET Core from the Windows Store
C) By using Visual Studio only
D) It is pre-installed with macOS and Linux
Which .NET Core version brought support for ARM-based processors?
A) .NET Core 1.0
B) .NET Core 2.0
C) .NET Core 3.0
D) .NET 5.0
Which feature of .NET Core allows it to run on various operating systems?
A) .NET Core runtime
B) .NET Core’s native support for hardware
C) Cross-platform libraries
D) Web assembly
What is one of the main benefits of using .NET 5+ over earlier versions of .NET Core?
A) It is no longer open-source
B) It has improved compatibility across different platforms
C) It is exclusive to Windows
D) It no longer supports mobile development
2. Cross-Platform Development with C#
Which of the following is the main language used for cross-platform development in .NET Core?
A) C#
B) JavaScript
C) Python
D) Java
Which cross-platform frameworks can be used with .NET Core for mobile development?
A) Xamarin
B) Angular
C) React Native
D) Flutter
How can C# code be executed on Linux and macOS using .NET Core?
A) By using a virtual machine
B) By installing the .NET Core runtime
C) By using Wine to run Windows applications
D) By converting the code into shell scripts
What is the primary benefit of using .NET Core for cross-platform development?
A) Compatibility with only Windows
B) Ability to write platform-specific code
C) Single codebase that can run on multiple platforms
D) Reduced development time for mobile applications
Which of the following tools helps in developing cross-platform applications in C#?
A) Visual Studio Code
B) Sublime Text
C) Notepad++
D) Eclipse
Which of the following allows .NET Core applications to run on macOS, Linux, and Windows?
A) Xamarin
B) .NET Core runtime
C) C# scripting
D) Docker containers
What command is used to create a new .NET Core project from the terminal?
A) dotnet new
B) create project
C) new .net
D) build project
Which of the following is an example of a cross-platform .NET Core app type?
A) Console applications
B) Web applications with ASP.NET Core
C) Desktop applications with WPF
D) Both A and B
What feature of .NET Core ensures that a C# application works on both Windows and Linux?
A) Platform-dependent libraries
B) Platform-agnostic APIs
C) Visual Studio integration
D) Only third-party packages
How does .NET Core achieve platform independence?
A) By using the Mono runtime
B) By compiling C# code into platform-specific executables
C) By using a common runtime and class libraries
D) By translating C# into Java bytecode
3. Building Console, Web, and Mobile Apps with .NET Core
Which project type is commonly used to build web applications in .NET Core?
A) Console application
B) ASP.NET Core Web Application
C) Windows Forms Application
D) Mobile App
Which of the following can be developed using .NET Core?
A) Console applications
B) Web applications
C) Mobile applications
D) All of the above
Which command is used to publish a .NET Core web application for deployment?
A) dotnet publish
B) dotnet deploy
C) dotnet build
D) dotnet run
What is the role of the ASP.NET Core framework in building web applications with .NET Core?
A) It provides tools for building scalable web services and APIs
B) It is used only for client-side scripting
C) It allows running server-side logic in browsers
D) It is only for building mobile applications
Which mobile framework is integrated with .NET Core for cross-platform mobile development?
A) Xamarin
B) React Native
C) Ionic
D) PhoneGap
How do you create a console application in .NET Core?
A) Using dotnet create console
B) Using dotnet new console
C) Using Visual Studio only
D) Using dotnet console
Which component of .NET Core allows for building APIs for mobile and web applications?
A) ASP.NET Core Web API
B) Xamarin
C) Blazor
D) WPF
Which of the following is NOT a supported platform for .NET Core applications?
A) macOS
B) Linux
C) Android
D) iOS
What is the primary benefit of building web applications with ASP.NET Core in .NET Core?
A) It only works with Windows-based servers
B) It allows easy integration with legacy .NET Framework apps
C) It supports cloud-native, cross-platform applications
D) It is primarily for desktop applications
Which of the following tools helps you to run and test your .NET Core applications during development?
A) .NET CLI
B) Visual Studio
C) Visual Studio Code
D) All of the above
Answers
Qno
Answer
1
B) Cross-platform development
2
A) .NET Core is open-source and cross-platform
3
B) It combines .NET Core and .NET Framework
4
C) .NET Core 3.0
5
B) C#
6
B) To enable the compilation and execution of .NET applications
7
A) Through a package manager or installer for each OS
8
D) .NET 5.0
9
C) Cross-platform libraries
10
B) It has improved compatibility across different platforms
11
A) C#
12
A) Xamarin
13
B) By installing the .NET Core runtime
14
C) Single codebase that can run on multiple platforms
15
A) Visual Studio Code
16
B) .NET Core runtime
17
A) dotnet new
18
D) Both A and B
19
B) Platform-agnostic APIs
20
C) By using a common runtime and class libraries
21
B) ASP.NET Core Web Application
22
D) All of the above
23
A) dotnet publish
24
A) It provides tools for building scalable web services and APIs
25
A) Xamarin
26
B) Using dotnet new console
27
A) ASP.NET Core Web API
28
C) Android
29
C) It supports cloud-native, cross-platform applications