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 14, 2025

Visual Studio

Visual Studio “F5 Takes Forever” — IIS Express Cache

- 14.12.25 - ErcanOPAK comment on Visual Studio “F5 Takes Forever” — IIS Express Cache

✅ Fix Delete: .vs/ Then restart Visual Studio. Why IIS Express config cache becomes corrupted.

Read More
Wordpress

WordPress Slow First Load — Autoloaded Options Table

- 14.12.25 - ErcanOPAK comment on WordPress Slow First Load — Autoloaded Options Table

Run this: SELECT * FROM wp_options WHERE autoload = ‘yes’; Too many rows = slow site. ✅ Fix Disable autoload on unused options. This alone can cut TTFB in half.

Read More
Windows

Windows 11 Laptop Overheats — Turbo Boost Gone Wrong

- 14.12.25 - ErcanOPAK comment on Windows 11 Laptop Overheats — Turbo Boost Gone Wrong

Turbo Boost causes thermal throttling loops. ✅ Fix Limit max CPU to 99%: Power Options → Processor → Maximum Processor State → 99% Why Disables Turbo without killing performance.

Read More
Windows

Windows 11 Slow Context Menu — The Explorer Extension Trap

- 14.12.25 - ErcanOPAK comment on Windows 11 Slow Context Menu — The Explorer Extension Trap

Third-party shell extensions slow everything. ✅ Fix Disable non-Microsoft extensions using ShellExView. Result Instantly faster right-click menus.

Read More
Ajax / JavaScript

AJAX “Works Once, Then Fails” — Cached POST Response

- 14.12.25 - ErcanOPAK comment on AJAX “Works Once, Then Fails” — Cached POST Response

Some browsers cache aggressively. ✅ Fix fetch(url, { method: ‘POST’, cache: ‘no-store’ }); Especially important for forms authentication dynamic APIs

Read More
JavaScript

JS Memory Leaks — Forgotten Event Listeners

- 14.12.25 - ErcanOPAK comment on JS Memory Leaks — Forgotten Event Listeners

Single-page apps suffer badly from this. ❌ window.addEventListener(‘resize’, handler); ✅ window.removeEventListener(‘resize’, handler); Always clean up listeners on unmount or destroy.

Read More
HTML

HTML5 button Defaults to submit (Surprise!)

- 14.12.25 - ErcanOPAK comment on HTML5 button Defaults to submit (Surprise!)

This causes accidental form submissions. ❌ <button>Click</button> ✅ <button type=”button”>Click</button> Rule Always set the button type explicitly.

Read More
CSS

CSS opacity Breaks Child Elements — Use RGBA Instead

- 14.12.25 - ErcanOPAK comment on CSS opacity Breaks Child Elements — Use RGBA Instead

❌ .card { opacity: 0.8; } This also fades text and icons. ✅ .card { background-color: rgba(0,0,0,0.8); } Why Opacity affects the entire element tree.

Read More
Asp.Net Core / C#

ASP.NET Core Health Checks That Actually Matter

- 14.12.25 - ErcanOPAK comment on ASP.NET Core Health Checks That Actually Matter

Many health checks always return OK. ❌ Useless services.AddHealthChecks(); ✅ Useful services.AddHealthChecks() .AddSqlServer(conn) .AddRedis(redisConn); Why Kubernetes and load balancers rely on this.

Read More
Asp.Net Core / C#

ASP.NET Core “Slow Startup” — Reflection Scanning Trap

- 14.12.25 - ErcanOPAK comment on ASP.NET Core “Slow Startup” — Reflection Scanning Trap

Large projects often scan assemblies repeatedly. ✅ Fix Disable automatic scanning where possible and register explicitly: services.AddScoped<IService, Service>(); Why Reflection is slow at startup — especially in containers.

Read More
SQL

SQL SELECT * — The Hidden Future Bug

- 14.12.25 - ErcanOPAK comment on SQL SELECT * — The Hidden Future Bug

Works today, breaks tomorrow. ❌ SELECT * FROM Users; ✅ SELECT Id, Name, Email FROM Users; Why Schema changes break consumers Pulls unnecessary data Slower network and memory usage

Read More
SQL

SQL “Index Fragmentation Panic” — When NOT to Rebuild

- 14.12.25 - ErcanOPAK comment on SQL “Index Fragmentation Panic” — When NOT to Rebuild

Many rebuild indexes blindly. ❌ Bad Habit ALTER INDEX ALL ON Orders REBUILD; ✅ Smart Rule Fragmentation < 5% → do nothing 5–30% → REORGANIZE 30% → REBUILD ALTER INDEX IX_Orders_Date ON Orders REORGANIZE; Why Rebuild = blocking + log growth.

Read More
C#

C# Exception Handling — The Silent Performance Killer

- 14.12.25 - ErcanOPAK comment on C# Exception Handling — The Silent Performance Killer

Exceptions are expensive.They are not flow control. ❌ try { return dict[key]; } catch { return null; } ✅ return dict.TryGetValue(key, out var value) ? value : null; Rule If it can fail often → do NOT use exceptions.

Read More
C#

C# “foreach Is Slower Than for” — Yes, Sometimes

- 14.12.25 - ErcanOPAK comment on C# “foreach Is Slower Than for” — Yes, Sometimes

On List<T> this matters in tight loops. ❌ foreach (var item in list) { } ✅ Faster for (int i = 0; i < list.Count; i++) { } Why foreach creates an enumerator for is index-based and faster Use this only in hot paths, not everywhere.

Read More
C#

C# Span — The Secret to Zero-Allocation Performance

- 14.12.25 - ErcanOPAK comment on C# Span — The Secret to Zero-Allocation Performance

If you manipulate strings or byte arrays heavily, this matters. ❌ Common Allocation Trap var part = input.Substring(0, 10); ✅ Zero-Allocation Alternative ReadOnlySpan<char> part = input.AsSpan(0, 10); Why this is huge No heap allocation No GC pressure Perfect for parsers and hot paths

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