Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access

Day: January 6, 2026

C#

C# Static Constructors Break Startup

- 06.01.26 - ErcanOPAK comment on C# Static Constructors Break Startup

App fails before logging. WhyExceptions thrown too early. FixMove logic out of static constructors.

Read More
C#

C# LINQ Kills Performance in Hot Paths

- 06.01.26 - ErcanOPAK comment on C# LINQ Kills Performance in Hot Paths

Readable but slow. WhyAllocations and deferred execution. FixUse loops in critical sections.

Read More
C#

C# async void Causes Invisible Crashes

- 06.01.26 - ErcanOPAK comment on C# async void Causes Invisible Crashes

No stack trace. WhyExceptions cannot be awaited. FixAvoid async void except event handlers.

Read More
SQL

SQL COUNT(*) Is Slower Than Expected

- 06.01.26 - ErcanOPAK comment on SQL COUNT(*) Is Slower Than Expected

Small table, big delay. WhyTable scan instead of index usage. FixUse indexed columns.

Read More
SQL

SQL Queries Slow Only After Server Restart

- 06.01.26 - ErcanOPAK comment on SQL Queries Slow Only After Server Restart

Then magically improve. WhyCold cache + outdated statistics. Fix UPDATE STATISTICS TableName;  

Read More
Asp.Net Core

.NET Core Memory Grows Without Leaks

- 06.01.26 - ErcanOPAK comment on .NET Core Memory Grows Without Leaks

GC runs but memory stays high. WhyLarge object heap fragmentation. FixReuse large buffers.

Read More
Asp.Net Core / C#

ASP.NET Core Requests Hang Randomly

- 06.01.26 - ErcanOPAK comment on ASP.NET Core Requests Hang Randomly

No exceptions thrown. WhyThread starvation due to sync-over-async. Fix await Task.Run(() => AsyncMethod()).ConfigureAwait(false);  

Read More
Git

Git Pull Breaks Local Changes Silently

- 06.01.26 - ErcanOPAK comment on Git Pull Breaks Local Changes Silently

No conflict shown. WhyAuto-merge with rerere. FixDisable rerere temporarily.

Read More
Git

Git History Looks Clean but Bugs Exist

- 06.01.26 - ErcanOPAK comment on Git History Looks Clean but Bugs Exist

Commits look fine. WhyLogical changes bundled together. FixUse smaller, purpose-driven commits.

Read More
Ajax / JavaScript

Ajax Calls Fail Only Behind Load Balancer

- 06.01.26 - ErcanOPAK comment on Ajax Calls Fail Only Behind Load Balancer

Direct calls succeed. WhyMissing forwarded headers. FixForward X-Forwarded-Proto.

Read More
JavaScript

JavaScript Memory Usage Keeps Growing

- 06.01.26 - ErcanOPAK comment on JavaScript Memory Usage Keeps Growing

No visible leaks. WhyDetached DOM nodes remain referenced. FixExplicitly null unused references.

Read More
HTML

HTML5 Videos Don’t Autoplay on Mobile

- 06.01.26 - ErcanOPAK comment on HTML5 Videos Don’t Autoplay on Mobile

Works on desktop. WhyMobile requires muted autoplay. Fix <video autoplay muted playsinline></video>  

Read More
CSS

CSS Animations Lag on Mobile Only

- 06.01.26 - ErcanOPAK comment on CSS Animations Lag on Mobile Only

Desktop smooth, mobile stutters. WhyLayout-triggering properties. Fix transform: translateZ(0);  

Read More
Windows

Windows 11 SSD Feels Slower Over Time

- 06.01.26 - ErcanOPAK comment on Windows 11 SSD Feels Slower Over Time

Benchmarks drop gradually. WhyIndexing + background telemetry. FixLimit indexing scope manually.

Read More
Windows

Windows 11 Taskbar Becomes Unresponsive

- 06.01.26 - ErcanOPAK comment on Windows 11 Taskbar Becomes Unresponsive

xplorer runs, UI frozen. WhyShell extensions crash silently. FixDisable third-party shell extensions.

Read More
AI

AI Prompt — Solve a Life Decision Clearly

- 06.01.26 - ErcanOPAK comment on AI Prompt — Solve a Life Decision Clearly

Prompt: Help me think clearly. List: – Emotional bias involved – Hidden risks – The safest reversible step Decision: <DESCRIBE>  

Read More
AI

AI Prompt — Refactor for Readability and Scale

- 06.01.26 - ErcanOPAK comment on AI Prompt — Refactor for Readability and Scale

Prompt: Refactor this code. Goals: – Reduce cognitive load – Improve long-term maintainability – Explain WHY each change matters Code: <PASTE CODE>  

Read More
AI

AI Prompt — Debug Code Like a Production Engineer

- 06.01.26 - ErcanOPAK comment on AI Prompt — Debug Code Like a Production Engineer

Prompt: Act as a senior production engineer. Explain: – Why this code works locally but fails under load – Hidden assumptions – The most likely real-world failure point Code: <PASTE CODE>  

Read More
Docker

Docker Containers Restart in a Loop

- 06.01.26 - ErcanOPAK comment on Docker Containers Restart in a Loop

Exit code 0 but container dies. WhyMain process exits immediately. FixEnsure a blocking foreground process.

Read More
Kubernetes

Kubernetes Pods Get Killed Without Errors

- 06.01.26 - ErcanOPAK comment on Kubernetes Pods Get Killed Without Errors

No logs. Just gone. WhyOOMKill triggered before logging flush. FixIncrease memory requests, not limits.

Read More
Wordpress

WordPress REST API Returns 401 Only in Production

- 06.01.26 - ErcanOPAK comment on WordPress REST API Returns 401 Only in Production

Local works, live breaks. WhySecurity plugins block unauthenticated REST calls. FixWhitelist REST routes explicitly.

Read More
Wordpress

WordPress Pages Randomly Lose Styles

- 06.01.26 - ErcanOPAK comment on WordPress Pages Randomly Lose Styles

Refresh fixes it… sometimes. WhyCSS is served before dynamic plugins finish execution. FixForce CSS loading order and avoid inline dynamic styles.

Read More
Photoshop

Photoshop Colors Look Different After Export

- 06.01.26 - ErcanOPAK comment on Photoshop Colors Look Different After Export

Perfect inside Photoshop, wrong everywhere else. WhyMissing or incorrect color profile. FixAlways convert to sRGB before export.

Read More
Photoshop

Photoshop Uses 100% CPU While Idle

- 06.01.26 - ErcanOPAK comment on Photoshop Uses 100% CPU While Idle

Nothing is open, fans go crazy. WhyPhotoshop continuously re-renders GPU previews. FixDisable Animated Zoom and Scrubby Zoom.

Read More
Visual Studio

Visual Studio Builds Succeed but App Runs Old Code

- 06.01.26 - ErcanOPAK comment on Visual Studio Builds Succeed but App Runs Old Code

You change the code, rebuild… nothing changes. WhyVisual Studio may reuse cached binaries when project references are unchanged. ImpactYou debug a version that no longer exists. Fix Disable Fast Up-To-Date Check Force MSBuild execution <PropertyGroup> <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck> </PropertyGroup>  

Read More
January 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Dec    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (924)
  • How to add default value for Entity Framework migrations for DateTime and Bool (820)
  • Get the First and Last Word from a String or Sentence in SQL (816)
  • How to select distinct rows in a datatable in C# (790)
  • How to make theater mode the default for Youtube (687)
  • Add Constraint to SQL Table to ensure email contains @ (565)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (545)
  • Average of all values in a column that are not zero in SQL (512)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (467)
  • Find numbers with more than two decimal places in SQL (433)

Recent Posts

  • Why foreach Is Sometimes Slower Than for
  • The Hidden Cost of Exceptions as Flow Control
  • Why lock Can Kill Throughput
  • Indexes Can Make Queries Slower (Here’s Why)
  • Why SELECT * Slowly Destroys Performance
  • The Real Cost of IHostedService Misuse
  • Why Async Controllers Still Block Threads
  • Stop Using git pull (Yes, Really)
  • Why Git Rebase “Loses” Commits (It Doesn’t — You Did)
  • Why Fetch Requests “Randomly” Hang (But Server Is Fine)

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (924)
  • How to add default value for Entity Framework migrations for DateTime and Bool (820)
  • Get the First and Last Word from a String or Sentence in SQL (816)
  • How to select distinct rows in a datatable in C# (790)
  • How to make theater mode the default for Youtube (687)

Recent Posts

  • Why foreach Is Sometimes Slower Than for
  • The Hidden Cost of Exceptions as Flow Control
  • Why lock Can Kill Throughput
  • Indexes Can Make Queries Slower (Here’s Why)
  • Why SELECT * Slowly Destroys Performance

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com