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: December 11, 2025

Visual Studio

VS “Breakpoints Hit Wrong Line” — The PDB Stale Cache Bug

- 11.12.25 - ErcanOPAK comment on VS “Breakpoints Hit Wrong Line” — The PDB Stale Cache Bug

Debugger attaches but steps on the wrong line?That’s stale PDB files. ✔ Fix: Delete: bin/ obj/ .vs/ Then: Clean → Rebuild → Restart VS 💡 Bonus Disable “fast up-to-date check” for large solutions.

Read More
PHP / Wordpress

WP “Menus Not Saving” — The Max Input Vars Killer

- 11.12.25 - ErcanOPAK comment on WP “Menus Not Saving” — The Max Input Vars Killer

Your menu refuses to save?You click save → NOTHING. ✔ Fix in php.ini: max_input_vars = 3000 Or WP-level: @ini_set( ‘max_input_vars’ , 3000 ); 💡 Why It Happens Large menus exceed PHP’s default 1000 variable limit.

Read More
Windows

Windows 11 “Search Bar Broken or Empty” — Rebuild Index the RIGHT Way

- 11.12.25 - ErcanOPAK comment on Windows 11 “Search Bar Broken or Empty” — Rebuild Index the RIGHT Way

Most people rebuild the index the wrong way. ✔ Correct Solution Run: PowerShell -Command “Get-AppxPackage Microsoft.Windows.Search* | Reset-AppxPackage” Then rebuild index. Fixes search for 99% of users.

Read More
Windows

Windows 11 “UI Stuttering” — The Hidden Hardware Accelerated GPU Scheduling Bug

- 11.12.25 - ErcanOPAK comment on Windows 11 “UI Stuttering” — The Hidden Hardware Accelerated GPU Scheduling Bug

For some GPUs, HAGS causes micro-stutters. ✔ Fix Turn off: Settings → System → Display → Graphics → Change default graphics settings → Hardware Accelerated GPU Scheduling = Off Instant smoothness boost.

Read More
Ajax / JavaScript

AJAX “POST Works Locally but Not in Production” — HTTPS Mixed Content

- 11.12.25 - ErcanOPAK comment on AJAX “POST Works Locally but Not in Production” — HTTPS Mixed Content

Local: HTTPProd: HTTPSBrowser blocks insecure AJAX calls with no error. ✔ Fix Always use relative URLs: $.post(‘/api/users’, data); Avoid: $.post(‘http://localhost/api/users’, data); // ❌  

Read More
JavaScript

JS “setInterval Drift” — Why Your Timers Run Slower Over Time

- 11.12.25 - ErcanOPAK comment on JS “setInterval Drift” — Why Your Timers Run Slower Over Time

setInterval accumulates drift because execution time is included. ✔ Fix: Self-adjusting timer const start = Date.now(); let count = 0; function tick() { count++; const next = start + count * 1000; setTimeout(tick, next – Date.now()); } tick(); Accurate to the millisecond.

Read More
CSS / HTML

HTML5 “Broken Autofill Styles” — Chrome’s Yellow Background Bug

- 11.12.25 - ErcanOPAK comment on HTML5 “Broken Autofill Styles” — Chrome’s Yellow Background Bug

Chrome applies weird autofill yellow color using a shadow DOM style. ✔ Fix input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px white inset; } 💡 Works for: light themes dark themes password inputs

Read More
CSS

CSS “Z-Index Doesn’t Work!” — The Parent Stacking Context Curse

- 11.12.25 - ErcanOPAK comment on CSS “Z-Index Doesn’t Work!” — The Parent Stacking Context Curse

The REAL reason z-index fails: A parent has position + z-index→ it creates a new stacking context. ✔ Fix Remove z-index from parent OR apply a higher z-index to the parent itself. 💡 Debug Trick Apply: outline: 2px solid red; To visualize stacking contexts.

Read More
Asp.Net Core / C#

.NET Core “HttpClient Exhaustion” — Why Your API Suddenly Stops Responding

- 11.12.25 - ErcanOPAK comment on .NET Core “HttpClient Exhaustion” — Why Your API Suddenly Stops Responding

Most devs know not to use new HttpClient(),but they forget the REAL killer: DNS caching. Containers change DNS → HttpClient reuses stale DNS forever. ✔ Fix Use SocketsHttpHandler.PooledConnectionIdleTimeout: builder.Services.AddHttpClient(“api”) .ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) }); Prevents DNS poisoning.

Read More
Asp.Net Core

ASP.NET Core “Random 404 After Deploy” — Broken Routing Cache

- 11.12.25 - ErcanOPAK comment on ASP.NET Core “Random 404 After Deploy” — Broken Routing Cache

Kestrel caches endpoints.When you add a new route but deploy without clearing the build output → ghost routes happen. ✔ Fix Add this to .csproj: <PropertyGroup> <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck> </PropertyGroup> Ensures routes rebuild properly every deploy.

Read More
SQL

SQL “Parameter Sniffing Hell” — The REAL Fix Nobody Uses

- 11.12.25 - ErcanOPAK comment on SQL “Parameter Sniffing Hell” — The REAL Fix Nobody Uses

When SQL caches a plan for one specific parameter, other queries become slow. Most people use OPTION RECOMPILE.BUT the REAL fix? ✔ Create an optimized local variable DECLARE @local INT = @UserId; SELECT … WHERE UserId = @local; SQL can no longer sniff the parameter → balanced plan for all users.

Read More
Development / SQL

SQL “Zombie TempDB” — The Invisible Performance Killer

- 11.12.25 - ErcanOPAK comment on SQL “Zombie TempDB” — The Invisible Performance Killer

TempDB grows silently until EVERYTHING slows. ✔ Fix: Right-size files ALTER DATABASE tempdb MODIFY FILE (NAME=’tempdev’, SIZE=4GB); And create multiple TempDB files: 4–8 files = massive improvement 💡 Why? TempDB is used for: joins sorting hashing version store This tweak alone boosts 90% of sluggish systems.

Read More
C#

C# “DateTime.Now Is Lying to You” — The Hidden Clock Skew Bug

- 11.12.25 - ErcanOPAK comment on C# “DateTime.Now Is Lying to You” — The Hidden Clock Skew Bug

Microservices deployed across containers = clock drifting. DateTime.Now can differ by 1-4 seconds between services → token validation fails → weird 401 errors. ✔ Use: DateTime.UtcNow Even better: ISystemClock clock 💡 Hidden Detail JWT validation is extremely sensitive to skew.Use: ClockSkew = TimeSpan.FromMinutes(2)  

Read More
C#

C# Memory Leak: Event Handlers Never Unsubscribe

- 11.12.25 - ErcanOPAK comment on C# Memory Leak: Event Handlers Never Unsubscribe

The classic leak: service.OnData += Handler; If you never do: service.OnData -= Handler; your entire object stays in memory FOREVER. ✔ Life-Saving Pattern using var reg = service.OnData.Register(Handler); Self-disposing event registration.Almost nobody uses this but it prevents weeks-long debugging nightmares.

Read More
C# / LINQ

C# “Async LINQ Disaster” — Why Your Parallel Queries Freeze Your App

- 11.12.25 | 11.12.25 - ErcanOPAK comment on C# “Async LINQ Disaster” — Why Your Parallel Queries Freeze Your App

Developers commonly mix async with LINQ: var results = items.Select(async x => await Process(x)); await Task.WhenAll(results); Looks correct, right?Nope. This triggers thousands of async state machines, killing perf. await Parallel.ForEachAsync(items, async (item, ct) => { await Process(item); }); 💡 Why It Saves You uses shared workers avoids micro-task explosion predictable throughput

Read More
December 2025
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Nov   Jan »

Most Viewed Posts

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

Recent Posts

  • C# Value Types Copied More Than You Think
  • C# Async Void Is Dangerous
  • C# Foreach vs For Performance Difference
  • SQL Deletes Lock Tables
  • SQL Queries Slow Despite Indexes
  • .NET Core APIs Feel Slow Under Load
  • ASP.NET Core Memory Grows Slowly
  • Git Conflicts Keep Reappearing
  • Git Rebase Feels Dangerous
  • Ajax Forms Submit Twice

Most Viewed Posts

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

Recent Posts

  • C# Value Types Copied More Than You Think
  • C# Async Void Is Dangerous
  • C# Foreach vs For Performance Difference
  • SQL Deletes Lock Tables
  • SQL Queries Slow Despite Indexes

Social

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