Your ASP.NET API randomly hangs under load. EF Core DbContext is being reused incorrectly, causing connection leaks. Fix the lifetime and disposal problem.
Developers often call async methods using .Result or .Wait(), causing deadlocks. Rewrite the API to fully use async/await.
Timers and event handlers keep class instances alive, causing memory leaks in long-running APIs. Fix by unregistering callbacks.
Your API returns large objects and is slow due to System.Text.Json using default configuration. Add caching, reduced depth, and improved serialization settings.
Creating new HttpClient per request causes socket exhaustion. Switch to HttpClientFactory for pooled handlers.
Event handlers keep objects alive, preventing garbage collection.
Singleton implementation is not thread-safe, causing multiple instances.
Event handlers keep objects alive, preventing garbage collection.
Nullable reference types not enabled, causing NRE at runtime.
User input concatenated into raw SQL query, vulnerable to SQL injection.
Singleton implementation not thread-safe, allowing multiple instances.
File streams are not disposed, causing file handle exhaustion.
Dictionary accessed from multiple threads without synchronization.
Creating new HttpClient per request exhausts sockets.
Async void methods can't be awaited and exceptions are unhandled.
Library code doesn't use ConfigureAwait(false), causing deadlocks.
Timer continues running after object is disposed, causing memory leak.
Loading related entities triggers N+1 queries, causing performance issues.
String concatenation in loop creates many intermediate strings.
Repeated reflection operations cause performance degradation.
Task is not awaited, causing exceptions to be lost.
Two services depend on each other, causing circular dependency.
Static events keep subscribers alive, preventing garbage collection.
Double-checked locking pattern incorrectly implemented.
Async method doesn't handle cancellation or exceptions properly.
Change tracking enabled for read-only queries, causing performance degradation.