
Configuration & Settings
appsettings.json, user secrets, environment variables, options pattern, best practices
1What is the default priority order of configuration sources in ASP.NET Core?
What is the default priority order of configuration sources in ASP.NET Core?
Câu trả lời
Configuration sources are read in a specific order where later sources override earlier ones. Environment variables have the highest priority, followed by appsettings.{Environment}.json, then appsettings.json. User Secrets is only loaded in Development environment and has lower priority than environment variables.
2What is the main benefit of using separate appsettings.{Environment}.json files?
What is the main benefit of using separate appsettings.{Environment}.json files?
Câu trả lời
appsettings.{Environment}.json files allow defining environment-specific configurations without changing code. For example, a local connection string in Development and an Azure connection string in Production. This avoids hardcoding values or modifying code during deployment.
3What is the main role of User Secrets in ASP.NET Core?
What is the main role of User Secrets in ASP.NET Core?
Câu trả lời
User Secrets stores secrets (API keys, connection strings) in a local JSON file located outside the project, typically in the user directory. This prevents accidentally committing secrets to Git. User Secrets is only loaded in Development environment and should never be used in production.
What is the key difference between IOptions<T> and IOptionsSnapshot<T>?
When should you use IOptionsMonitor<T> instead of IOptionsSnapshot<T>?
+17 câu hỏi phỏng vấn
Các chủ đề phỏng vấn .NET khác
C# Basics
LINQ & Delegates
C# Language Essentials
ASP.NET Core Fundamentals
ASP.NET Core Request Lifecycle
Application Lifecycle
Dependency Injection
Entity Framework Core
Minimal APIs
Web API Development
Async in ASP.NET Core
Authentication & Authorization
HttpClient & Networking
JSON Serialization
Entity Framework Core Advanced
C# Advanced Features
Clean Architecture
Logging, Monitoring & Observability
Unit Testing & xUnit
Integration Testing
Docker & Containerization
NuGet Package Management
Memory Management & GC
Reactive Programming
Async/await & Patterns
.NET Design Patterns
Performance Optimization
Security & Best Practices
SignalR & Real-time
Microservices Architecture
Nắm vững .NET cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí