Land the job you want — prepare
with Real interviews Q&A
Curated interview questions, company-wise guides and coding rounds. Practice mock interviews, improve with feedback, and track your progress.
.NET Core is a free, open-source, cross-platform framework developed by Microsoft for building modern applications.
It allows developers to create:
- Web applications
- Web APIs
- Desktop apps
- Cloud applications
- Microservices
- Mobile backends
Why .NET Core is Popular
- High performance
- Cross-platform support
- Open-source development
- Cloud-ready architecture
- Easy deployment
That means applications built with .NET Core can run on multiple operating systems, including:
- Windows
- Linux
- macOS
- Cloud computing
- Docker containers
- Linux servers
- Modern development environments
Why This is Important
Older .NET Framework mainly worked only on Windows.
Both .NET Framework and .NET Core are development platforms created by Microsoft, but they are designed for different purposes.
| Feature | .NET Framework | .NET Core |
|---|---|---|
| Platform Support | Windows Only | Windows, Linux, macOS |
| Open Source | ✖ Partial | ✔ Fully Open Source |
| Performance | Slower | Faster |
| Application Type | Traditional Desktop & Web Apps | Modern Cloud & Microservices Apps |
| Cross-Platform | ✖ No | ✔ Yes |
| Deployment | System-wide Installation | Flexible & Self-contained |
| Docker Support | ✖ Limited | ✔ Excellent |
| Microservices Support | ✖ Not Ideal | ✔ Excellent |
| Command Line Support | ✖ Limited | ✔ Strong CLI Support |
| Side-by-Side Versioning | ✖ Difficult | ✔ Supported |
| Best Use Case | Legacy Enterprise Applications | Modern Scalable Applications |
| Current Microsoft Focus | ✖ Maintenance Mode | ✔ Actively Developed |
Kestrel is a lightweight, fast, cross-platform web server used by ASP.NET Core applications.It is the default web server for ASP.NET Core.
Kestrel is the server that runs and listens for HTTP requests in ASP.NET Core applications.
When a browser requests: http://localhost:5000
Kestrel receives the request and sends back the response.
What Kestrel Does
Kestrel handles:
- HTTP requests
- HTTPS requests
- WebSocket connections
- API traffic
| Feature | Kestrel |
|---|---|
| Type | Web Server |
| Used With | ASP.NET Core |
| Cross-Platform | ✔ Yes |
| Default Server | ✔ Yes |
| Performance | High Performance |
| Lightweight | ✔ Yes |
| Supports HTTPS | ✔ Yes |
| Supports WebSockets | ✔ Yes |
| Runs On | Windows, Linux, macOS |
| Default HTTP Port | 5000 |
| Default HTTPS Port | 5001 |
| Production Usage | Often Used Behind IIS/Nginx |
| Main Purpose | Handle HTTP Requests |
Middleware in ASP.NET Core is software/components that handle HTTP requests and responses in the application pipeline.
Each middleware component can:
- Process the request
- Modify the request/response
- Pass control to the next middleware
- Stop the request pipeline
Middleware Pipeline
Request ↓ Authentication Middleware ↓ Authorization Middleware ↓ Routing Middleware ↓ Controller/API ↓ Response
| Middleware | Purpose |
|---|---|
| Authentication | Verify User Identity |
| Authorization | Check User Permissions |
| Routing | Match URL Routes |
| Static Files | Serve CSS, JS, Images |
| CORS | Handle Cross-Origin Requests |
| Exception Handling | Catch & Handle Errors |
| HTTPS Redirection | Redirect HTTP to HTTPS |
| Session | Store User Session Data |
| Response Compression | Reduce Response Size |
| Logging | Log Request & Response Details |
| Cookie Policy | Manage Cookie Settings |
| Endpoint Middleware | Execute Matched Endpoints |
Answer HereAnswer Herebuilder.Services.AddCors(); app.UseCors();Answer Heredotnet ef migrations add InitialCreatedotnet ef database updatevar value = builder.Configuration["Key"];logger.LogInformation("Message");builder.Services.AddAuthentication().AddJwtBearer();Answer Here