Deployment MCQs ASP.NET

Which of the following is used to deploy an ASP.NET Core application?
A. IIS
B. Apache
C. Nginx
D. All of the above
Answer: D

What is the default deployment model for ASP.NET Core?
A. In-Process
B. Out-of-Process
C. Docker
D. Azure
Answer: A

Which command is used to publish an ASP.NET Core application?
A. dotnet deploy
B. dotnet run
C. dotnet build
D. dotnet publish
Answer: D

Where is the deployment configuration for an ASP.NET Core application typically defined?
A. web.config
B. appsettings.json
C. launchSettings.json
D. deployment.json
Answer: B

What is the primary benefit of using Docker to deploy an ASP.NET application?
A. Version control
B. Code optimization
C. Cross-platform compatibility
D. Faster debugging
Answer: C

Which file is created when you deploy an ASP.NET Core application to IIS?
A. WebHost.config
B. web.config
C. launchSettings.json
D. appsettings.json
Answer: B

What is Kestrel in ASP.NET Core?
A. A web server
B. A database
C. A deployment tool
D. A logging framework
Answer: A

Which of the following deployment modes allows an ASP.NET Core application to be hosted independently of IIS?
A. Self-contained
B. Framework-dependent
C. In-Process
D. Windows Service
Answer: A

In a framework-dependent deployment, what is required on the target machine?
A. .NET Core runtime
B. Visual Studio
C. Node.js
D. IIS Express
Answer: A

What is the default port number used by Kestrel in an ASP.NET Core application?
A. 8080
B. 80
C. 5000
D. 443
Answer: C

What type of deployment bundles the .NET runtime with the application?
A. Framework-dependent
B. Self-contained
C. Azure-based
D. Cloud-native
Answer: B

Which of the following can be used to deploy an ASP.NET Core app to Azure?
A. Visual Studio
B. Azure CLI
C. Azure DevOps
D. All of the above
Answer: D

What is the purpose of dotnet publish in ASP.NET Core?
A. To build the application
B. To compile the source code
C. To prepare the application for deployment
D. To run the application
Answer: C

Which file is used to configure environment-specific settings in an ASP.NET Core application?
A. launchSettings.json
B. appsettings.json
C. environment.config
D. deploy.json
Answer: B

What role does the Program.cs file play in ASP.NET Core deployment?
A. It contains the deployment settings
B. It defines the entry point of the application
C. It configures environment variables
D. It manages user authentication
Answer: B

Which deployment option allows ASP.NET Core applications to run on Linux?
A. IIS Deployment
B. Windows Service
C. Docker Containers
D. MSDeploy
Answer: C

How can you deploy an ASP.NET Core application as a Windows Service?
A. Use IIS
B. Configure it in Program.cs using Host.CreateDefaultBuilder
C. Use Docker
D. Publish using dotnet build
Answer: B

What is the purpose of dotnet restore during deployment?
A. To restore application state
B. To restore the app to a previous version
C. To install NuGet dependencies
D. To optimize performance
Answer: C

Which of the following cloud platforms supports ASP.NET Core deployment?
A. Google Cloud Platform
B. Microsoft Azure
C. Amazon Web Services
D. All of the above
Answer: D

Which tool can be used for continuous deployment of ASP.NET Core apps to Azure?
A. GitHub Actions
B. Jenkins
C. Azure DevOps
D. All of the above
Answer: D

In an ASP.NET Core application, what is the function of the web.config file when deploying to IIS?
A. Manage routing
B. Define environmental variables
C. Configure the reverse proxy
D. Set authentication methods
Answer: C

Which deployment model is recommended for container-based deployments in ASP.NET Core?
A. Self-contained
B. Framework-dependent
C. Cloud-native
D. Hybrid
Answer: A

What is the command to install the .NET Core runtime on a Linux server?
A. sudo apt install dotnet-runtime
B. dotnet install core
C. dotnet init
D. sudo install net-runtime
Answer: A

Which of the following can be used to monitor ASP.NET Core applications in production?
A. Application Insights
B. IIS Manager
C. Serilog
D. All of the above
Answer: D

What is the purpose of a reverse proxy like Nginx in ASP.NET Core deployment?
A. To handle requests and forward them to Kestrel
B. To serve static files
C. To deploy code to Azure
D. To optimize database queries
Answer: A

Which platform supports the deployment of ASP.NET Core apps with WebAssembly?
A. Blazor
B. MVC
C. Angular
D. React
Answer: A

Which service in Azure is used to deploy and host web applications?
A. Azure App Service
B. Azure Storage
C. Azure Kubernetes Service
D. Azure Functions
Answer: A

Which of the following methods can be used to deploy ASP.NET Core applications to IIS?
A. XCopy
B. WebDeploy
C. Docker
D. All of the above
Answer: B

Which protocol is commonly used to secure ASP.NET Core applications in production?
A. HTTP
B. HTTPS
C. FTP
D. WebSocket
Answer: B

Which logging tool can be used for monitoring during deployment?
A. Serilog
B. Log4Net
C. NLog
D. All of the above
Answer: D

In ASP.NET Core, what is the purpose of the appsettings.Production.json file?
A. To configure production-specific settings
B. To define the database schema
C. To handle environment switching
D. To log errors
Answer: A

What does the command dotnet publish -c Release do in an ASP.NET Core project?
A. Publishes the app in debug mode
B. Publishes the app in release mode
C. Builds the app without publishing
D. Runs the app in production
Answer: B

Which of the following deployment options allows for scaling of ASP.NET Core applications?
A. Docker Containers
B. Azure App Service
C. Kubernetes
D. All of the above
Answer: D

How is the deployment of ASP.NET Core applications to Azure handled in Visual Studio?
A. Through the Publish wizard
B. By configuring Docker
C. By using Git commands
D. By modifying launchSettings.json
Answer: A

What is the primary advantage of using a self-contained deployment for an ASP.NET Core app?
A. Smaller app size
B. Cross-platform support without requiring .NET Core on the server
C. Easier debugging
D. Faster runtime
Answer: B

Which of the following can be used for ASP.NET Core deployment automation?
A. Jenkins
B. Azure DevOps
C. GitLab CI/CD
D. All of the above
Answer: D

What is the benefit of using environment variables in ASP.NET Core deployment?
A. Easier configuration management
B. Faster code execution
C. Smaller app footprint
D. Better caching
Answer: A

Which of the following ensures zero-downtime deployment in ASP.NET Core?
A. Rolling deployment
B. In-place deployment
C. XCopy deployment
D. Side-by-side deployment
Answer: A

Which feature of ASP.NET Core helps in controlling configuration based on the environment?
A. Dependency Injection
B. Configuration Providers
C. Entity Framework
D. Middleware
Answer: B

How can you automate deployment using Azure Pipelines for an ASP.NET Core application?
A. By creating a release pipeline
B. By running dotnet publish
C. By configuring IIS manually
D. By uploading the application to Azure Storage
Answer: A

Which of the following is used to deploy ASP.NET Core applications with high availability?
A. Docker Swarm
B. Kubernetes
C. IIS
D. XCopy
Answer: B

Which setting needs to be modified for enabling HTTPS in an ASP.NET Core deployment?
A. appsettings.json
B. launchSettings.json
C. web.config
D. dockerfile
Answer: B

Which command is used to stop an ASP.NET Core application running on Kestrel?
A. Ctrl + C
B. dotnet stop
C. systemctl stop kestrel
D. stop-aspnet
Answer: A

Which of the following is a popular tool for logging in ASP.NET Core applications?
A. Log4Net
B. AppInsights
C. Serilog
D. All of the above
Answer: D