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 2, 2026

C#

Exceptions Used for Flow Control

- 02.01.26 - ErcanOPAK comment on Exceptions Used for Flow Control

Works… until scale. WhyExceptions are expensive. Fix Use Try-patterns instead.

Read More
C#

LINQ Causing Hidden Allocations

- 02.01.26 - ErcanOPAK comment on LINQ Causing Hidden Allocations

Clean code, slow runtime. WhyDeferred execution + boxing. Fix Materialize once when needed.

Read More
C#

C# Async Methods Still Block Threads

- 02.01.26 - ErcanOPAK comment on C# Async Methods Still Block Threads

Looks async, isn’t. WhyCPU-bound work inside async. Fix Offload CPU work explicitly. await Task.Run(() => HeavyCalculation());  

Read More
SQL

SQL Index Exists but Not Used

- 02.01.26 - ErcanOPAK comment on SQL Index Exists but Not Used

Planner ignores it. WhyLow selectivity. Fix Include filtered indexes.

Read More
SQL

SQL Queries Randomly Slow Down

- 02.01.26 | 03.01.26 - ErcanOPAK comment on SQL Queries Randomly Slow Down

Same query, different speed. WhyParameter sniffing. Fix Use OPTION (RECOMPILE) selectively. 🐌 Same Query, Different Speed Nothing changed. Except the parameters. If a query sometimes runs in 10 ms and sometimes in 10 seconds,you’re probably not looking at a missing index. You’re looking at parameter sniffing. 🚨 The Core Problem SQL Server creates an execution […]

Read More
Asp.Net Core

Middleware Order Breaks Security

- 02.01.26 - ErcanOPAK comment on Middleware Order Breaks Security

Auth enabled, still vulnerable. WhyMiddleware pipeline order matters. Fix Authentication must come before authorization.

Read More
Asp.Net Core

ASP.NET Core Memory Grows Forever

- 02.01.26 - ErcanOPAK comment on ASP.NET Core Memory Grows Forever

No leaks detected. WhySingleton services holding scoped dependencies. Fix Avoid injecting scoped services into singletons.

Read More
Git

Git Shows No Changes but Files Differ

- 02.01.26 - ErcanOPAK comment on Git Shows No Changes but Files Differ

Confusing diffs. WhyWhitespace normalization. Fix Configure .editorconfig.

Read More
Git

Git Rebase Broke Everything

- 02.01.26 | 03.01.26 - ErcanOPAK comment on Git Rebase Broke Everything

History rewritten, chaos. WhyForce-push on shared branch. Fix Only rebase local branches. 💥 Git Rebase Broke Everything History rewritten. Chaos followed. Git rebase is powerful.Used incorrectly, it’s destructive. Most Git disasters don’t come from bugs —they come from rewriting shared history. 🚨 The Core Problem git rebase rewrites commit history. That’s fine only if you’re […]

Read More
Ajax / JavaScript

Ajax Requests Timeout Only in Production

- 02.01.26 - ErcanOPAK comment on Ajax Requests Timeout Only in Production

Local works, prod fails. WhyReverse proxy timeout limits. Fix Increase server timeout or chunk responses.

Read More
JavaScript

JavaScript Memory Leaks Without Errors

- 02.01.26 - ErcanOPAK comment on JavaScript Memory Leaks Without Errors

Page slows over time. WhyDetached DOM references. Fix Null unused references.

Read More
HTML

HTML Forms Break Accessibility

- 02.01.26 - ErcanOPAK comment on HTML Forms Break Accessibility

Looks fine, fails screen readers. WhyMissing explicit label bindings. Fix Always link label with for.

Read More
CSS

CSS Animations Cause Page Jank

- 02.01.26 - ErcanOPAK comment on CSS Animations Cause Page Jank

Smooth on desktop, laggy on mobile. WhyLayout-triggering properties. Fix Animate only transform and opacity. .box { transform: translateX(0); transition: transform 300ms ease; }  

Read More
Windows

Windows 11 Audio Crackles Randomly

- 02.01.26 - ErcanOPAK comment on Windows 11 Audio Crackles Randomly

specially on Bluetooth. WhyPower management throttles audio devices. Fix Disable power saving on audio drivers.

Read More
Windows

Windows 11 High CPU with “System”

- 02.01.26 - ErcanOPAK comment on Windows 11 High CPU with “System”

Nothing running, CPU burning. WhyBackground indexing + driver loops. Fix Rebuild search index and update chipset drivers.

Read More
AI

AI Prompt — Solve Complex Problems Faster

- 02.01.26 - ErcanOPAK comment on AI Prompt — Solve Complex Problems Faster

Prompt Break this problem into: – Root causes – Constraints – Non-obvious risks – Simple first steps Problem: <DESCRIBE ISSUE>  

Read More
AI

AI Prompt — SQL Performance Autopsy

- 02.01.26 - ErcanOPAK comment on AI Prompt — SQL Performance Autopsy

Prompt Act as a senior DBA. Analyze this SQL query. Identify: – Index issues – Hidden scans – Cardinality problems Suggest a rewritten query. Query: <PASTE QUERY>  

Read More
AI

AI Prompt — Debug Async Deadlocks

- 02.01.26 - ErcanOPAK comment on AI Prompt — Debug Async Deadlocks

Prompt Analyze this async code. Explain: – Where deadlocks may occur – Why synchronization context matters – How to fix without changing behavior Code: <PASTE CODE>  

Read More
Docker

Docker Container Works Once, Then Fails

- 02.01.26 - ErcanOPAK comment on Docker Container Works Once, Then Fails

First run ok, second run broken. WhyStateful data written inside container layer. Fix Always mount volumes for persistent data.

Read More
Kubernetes

Kubernetes App Randomly Loses Traffic

- 02.01.26 - ErcanOPAK comment on Kubernetes App Randomly Loses Traffic

No crashes, no errors. WhyReadiness probes failing silently. Fix Separate readiness and liveness probes.

Read More
Wordpress

WordPress Login Works Locally, Fails on Hosting

- 02.01.26 - ErcanOPAK comment on WordPress Login Works Locally, Fails on Hosting

Same credentials, different result. WhyHosting uses aggressive object caching. Fix Clear object cache on password reset hook.

Read More
Wordpress

WordPress Admin Suddenly Becomes Extremely Slow

- 02.01.26 - ErcanOPAK comment on WordPress Admin Suddenly Becomes Extremely Slow

Frontend is fast, admin unusable. WhyHeavy meta queries triggered by custom fields. Fix Disable unnecessary post meta loading using remove_meta_box.

Read More
Photoshop

Photoshop Uses GPU but Still Feels Slow

- 02.01.26 - ErcanOPAK comment on Photoshop Uses GPU but Still Feels Slow

GPU enabled, zero benefit. WhyGPU acceleration only applies to specific operations. Fix Switch document color mode to 8-bit RGB before heavy edits.

Read More
Photoshop

Photoshop Images Look Blurry After Upload

- 02.01.26 - ErcanOPAK comment on Photoshop Images Look Blurry After Upload

Sharp locally, soft online. Root causeAutomatic resampling + wrong export scaling. Fix Export at 100% scale, disable resample, then let CSS handle resizing.

Read More
Visual Studio

Visual Studio Builds Succeed but Runtime Crashes

- 02.01.26 - ErcanOPAK comment on Visual Studio Builds Succeed but Runtime Crashes

Your solution builds perfectly… yet crashes immediately. Why this happensDifferent projects target different runtime versions, but MSBuild doesn’t warn you. Fix Force a single runtime in Directory.Build.props: <Project> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> </PropertyGroup> </Project> Why it worksIt guarantees consistent compilation and runtime behavior across all projects.

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