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
  • Privacy Policy

Author: ErcanOPAK

Wordpress

Disable WordPress Cron to Fix Random CPU Spikes

- 24.01.26 - ErcanOPAK comment on Disable WordPress Cron to Fix Random CPU Spikes

WordPress pseudo-cron (wp-cron.php) runs on page load — not time-based. Why this is bad:High traffic = cron storm = CPU spikes. Proper fix: define(‘DISABLE_WP_CRON’, true); Then add a real cron job: */5 * * * * wget -q -O – https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 Result:Predictable performance, lower server load, faster page responses.

Read More
Wordpress

Stop WordPress from Killing Your Site During Plugin Updates

- 24.01.26 - ErcanOPAK comment on Stop WordPress from Killing Your Site During Plugin Updates

A failed plugin update can lock WordPress into maintenance mode forever. Why it happens:WordPress creates a .maintenance file and never deletes it if PHP times out. Instant fix (no admin panel needed): /public_html/.maintenance Delete that file. Prevention (best practice): Add to wp-config.php: define(‘WP_MEMORY_LIMIT’, ‘256M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘256M’); This prevents update-time PHP crashes.

Read More
Photoshop

Fix Blurry Exports by Disabling Photoshop’s Hidden Downsampling

- 24.01.26 - ErcanOPAK comment on Fix Blurry Exports by Disabling Photoshop’s Hidden Downsampling

If your exported images look blurry despite correct resolution, Photoshop is silently downsampling. Root cause:“Bicubic Automatic” optimizes for speed, not clarity. Permanent fix: Edit → Preferences → General Image Interpolation → Bicubic Sharper For UI assets: Export As → Disable “Convert to sRGB” (if already RGB) Result:Crisp icons, sharp UI images, no more washed-out exports.

Read More
Photoshop

Recover “Lost” Layers from a Saved PSD Using History Scrubbing

- 24.01.26 - ErcanOPAK comment on Recover “Lost” Layers from a Saved PSD Using History Scrubbing

Photoshop doesn’t tell you this, but PSD files can retain layer data even after saving — especially if Auto-Recovery was enabled. Why it works:Photoshop keeps a hidden timeline buffer until the file is fully closed and memory is overwritten. How to recover: Open the PSD Go to Window → History Drag the history state backwards […]

Read More
Visual Studio

Visual Studio’s Hidden “File Lock” Cache That Breaks Your Build (And How to Flush It Safely)

- 24.01.26 - ErcanOPAK comment on Visual Studio’s Hidden “File Lock” Cache That Breaks Your Build (And How to Flush It Safely)

Sometimes Visual Studio fails to rebuild even after a full Clean + Rebuild.The reason is not your code — it’s VS holding file handles in its internal cache (especially after crashes or forced shutdowns). Why this matters:Locked DLLs cause ghost errors, outdated binaries, and “it works on my machine” nightmares. The fix (safe & instant): […]

Read More
Asp.Net Core / C#

Stop Wasting RAM: The Art of Zero-Allocation C#

- 23.01.26 - ErcanOPAK comment on Stop Wasting RAM: The Art of Zero-Allocation C#

How to achieve extreme performance in .NET 9 by mastering Span<T>, Memory<T>, and the Garbage Collector. In the world of cloud-native development, Memory is Money. Every byte you allocate on the Managed Heap is a debt that the Garbage Collector (GC) must eventually collect. The biggest bottleneck in high-throughput .NET applications isn’t typically the CPU’s […]

Read More
Asp.Net Core / C#

Is Your Clean Architecture Actually a “Dirty” Mess?

- 23.01.26 - ErcanOPAK comment on Is Your Clean Architecture Actually a “Dirty” Mess?

Why modern .NET 9 systems are moving away from rigid layers and embracing the “Vertical Slice” revolution. For the past decade, Clean Architecture (or Onion Architecture) has been the gold standard for .NET developers. We’ve been told to separate our concerns into layers: Domain, Application, Infrastructure, and Web. But as projects grow, we often find […]

Read More
Asp.Net Core / C#

The Most Expensive Mistake C# Developers Still Make in 2026

- 23.01.26 | 23.01.26 - ErcanOPAK comment on The Most Expensive Mistake C# Developers Still Make in 2026

How a single line of Task.Run can turn your high-performance C# application into a production time bomb. For years, C# has been marketed as a “safe” and “high-level” language. Garbage collection, async/await, dependency injection — all designed to protect developers from low-level mistakes. And yet… Some of the most expensive production failures I’ve seen in […]

Read More
C#

C# Value Types Passed Incorrectly

- 23.01.26 - ErcanOPAK comment on C# Value Types Passed Incorrectly

Unexpected copies. Why it happensMissing in keyword. Why it mattersPerf degradation. Vital fix void Process(in LargeStruct data)  

Read More
C#

C# LINQ Looks Clean but Allocates Heavily

- 23.01.26 - ErcanOPAK comment on C# LINQ Looks Clean but Allocates Heavily

Readable but slow. Why it happensDeferred execution + allocations. Why it mattersGC pressure. Vital fix Use loops in hot paths.

Read More
C#

C# Exceptions Kill Performance Silently

- 23.01.26 - ErcanOPAK comment on C# Exceptions Kill Performance Silently

No crash, but slow. Why it happensExceptions used as control flow. Why it mattersHidden overhead. Vital fix Avoid exceptions in hot paths.

Read More
SQL

SQL COUNT(*) Slows Down Reports

- 23.01.26 - ErcanOPAK comment on SQL COUNT(*) Slows Down Reports

Simple count, slow execution. Why it happensFull table scan. Why it mattersReports lag. Vital fix Use indexed counts when possible.

Read More
SQL

SQL Index Exists but Is Ignored

- 23.01.26 - ErcanOPAK comment on SQL Index Exists but Is Ignored

Planner avoids it. Why it happensLow selectivity. Why it mattersSlow queries. Vital fix Index columns with high cardinality.

Read More
Asp.Net Core

.NET Core Logs Disappear in Production

- 23.01.26 - ErcanOPAK comment on .NET Core Logs Disappear in Production

Local logs OK, prod empty. Why it happensWrong logging provider configuration. Why it mattersNo observability. Vital fix Explicitly configure providers.

Read More
Asp.Net Core

ASP.NET Core APIs Hang Under Load

- 23.01.26 - ErcanOPAK comment on ASP.NET Core APIs Hang Under Load

CPU low, requests hang. Why it happensThread pool starvation. Why it mattersThroughput collapses. Vital fix Avoid blocking calls in async paths.

Read More
Git

Git Pull Breaks Local Changes

- 23.01.26 - ErcanOPAK comment on Git Pull Breaks Local Changes

No conflicts, code wrong. Why it happensAutomerge overwrote assumptions. Why it mattersSilent regressions. Vital fix Review diffs before pull.

Read More
Git

Git History Looks Clean but Bugs Appear

- 23.01.26 - ErcanOPAK comment on Git History Looks Clean but Bugs Appear

Commits fine, logic broken. Why it happensReverts without context. Why it mattersDebugging history useless. Vital fix Prefer revert commits with explanations.

Read More
Ajax / JavaScript

Ajax Requests Succeed but UI Never Updates

- 23.01.26 - ErcanOPAK comment on Ajax Requests Succeed but UI Never Updates

Network OK, UI frozen. Why it happensState updated outside render cycle. Why it mattersUsers see stale data. Vital fix Centralize state updates.

Read More
JavaScript

JavaScript Objects Grow Memory Over Time

- 23.01.26 - ErcanOPAK comment on JavaScript Objects Grow Memory Over Time

No leaks visible. Why it happensDetached DOM references. Why it mattersLong sessions slow down. Vital fix Null references explicitly.

Read More
HTML

HTML Buttons Submit Forms Accidentally

- 23.01.26 - ErcanOPAK comment on HTML Buttons Submit Forms Accidentally

Click → page reload. Why it happensDefault button type is submit. Why it mattersUnexpected behavior. Vital fix <button type=”button”>  

Read More
CSS

CSS Animations Cause Scroll Jank

- 23.01.26 - ErcanOPAK comment on CSS Animations Cause Scroll Jank

UI feels heavy. Why it happensAnimating layout properties. Why it mattersBad UX on mobile. Vital fix Use transform & opacity only  

Read More
Windows

Windows 11 Audio Crackles After Sleep

- 23.01.26 - ErcanOPAK comment on Windows 11 Audio Crackles After Sleep

Sound breaks after wake. Why it happensDriver power state mismatch. Why it mattersMeetings ruined. Vital fix Disable audio power saving in Device Manager.

Read More
Windows

Windows 11 Laptop Wakes Up Randomly

- 23.01.26 - ErcanOPAK comment on Windows 11 Laptop Wakes Up Randomly

Closed lid, battery drained. Why it happensWake timers or network adapters. Why it mattersBattery health degrades. Vital fix powercfg /lastwake  

Read More
AI

AI Prompt — Personal Knowledge Simplifier (General)

- 23.01.26 - ErcanOPAK comment on AI Prompt — Personal Knowledge Simplifier (General)

Summarize this topic so I can explain it to a non-technical person in 2 minutes. Topic:  

Read More
AI

AI Prompt — SQL Query Refactor

- 23.01.26 - ErcanOPAK comment on AI Prompt — SQL Query Refactor

Rewrite this SQL query for performance. Explain why each change improves execution. Query:  

Read More
AI

AI Prompt — Code Risk Scanner

- 23.01.26 - ErcanOPAK comment on AI Prompt — Code Risk Scanner

Review this code as if it will run in production for 3 years. List hidden risks, edge cases, and scalability concerns. Code:  

Read More
Docker

Docker Builds Are Slow Even with Small Changes

- 23.01.26 - ErcanOPAK comment on Docker Builds Are Slow Even with Small Changes

One line edit → full rebuild. Why it happensCOPY order invalidates cache. Why it mattersCI/CD pipelines slow down. Vital fix COPY *.csproj . RUN dotnet restore COPY . .  

Read More
Kubernetes

Kubernetes Pods Restart with No CPU or Memory Spikes

- 23.01.26 - ErcanOPAK comment on Kubernetes Pods Restart with No CPU or Memory Spikes

Metrics look clean, pods restart anyway. Why it happensProcess exits with code 0 (app logic exit). Why it mattersKubernetes assumes failure. Vital fix Keep main process alive or use proper controllers.

Read More
Wordpress

WordPress Theme Updates Break Custom Fixes

- 23.01.26 - ErcanOPAK comment on WordPress Theme Updates Break Custom Fixes

Everything works… until update day. Why it happensEdits made directly to theme files. Why it mattersCustomizations get wiped. Vital fix Always use a child theme.

Read More
Wordpress

WordPress Pages Load Slowly Only for Logged-In Users

- 23.01.26 - ErcanOPAK comment on WordPress Pages Load Slowly Only for Logged-In Users

Guests are fast, admins suffer. Why it happensAdmin bar + disabled cache for logged-in users. Why it mattersYou think the site is slow — users don’t. Vital fix Test performance in incognito + cache enabled.

Read More
Page 32 of 69
« Previous 1 … 27 28 29 30 31 32 33 34 35 36 37 … 69 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

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