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

Photoshop

Photoshop Exported PNGs Are Huge

- 05.01.26 | 05.01.26 - ErcanOPAK comment on Photoshop Exported PNGs Are Huge

Quality is fine, size is insane. Why16-bit color depth exported unnecessarily. FixConvert document to 8-bit before export.

Read More
Photoshop

Photoshop Files Open Extremely Slowly

- 05.01.26 - ErcanOPAK comment on Photoshop Files Open Extremely Slowly

No crash, just long waiting times. WhyLarge embedded previews and unused layer comps. FixDisable “Maximize PSD Compatibility” and remove unused comps.

Read More
Visual Studio

Visual Studio Breakpoints Are Never Hit

- 05.01.26 - ErcanOPAK comment on Visual Studio Breakpoints Are Never Hit

The app runs, but breakpoints stay hollow. Why this happensPDB files are out of sync with the compiled binaries. Root causeIncremental builds reuse outdated symbols. Fix Clean solution and force a full rebuild.Also verify “Just My Code” settings.

Read More
C#

IEnumerable Executes More Than Once

- 04.01.26 - ErcanOPAK comment on IEnumerable Executes More Than Once

Unexpected duplicate work. WhyDeferred execution. Fix var data = query.ToList();  

Read More
C#

Boxing Happens Without You Noticing

- 04.01.26 - ErcanOPAK comment on Boxing Happens Without You Noticing

Performance drops mysteriously. WhyInterfaces cause value types to box. Fix Use generics to avoid boxing.

Read More
C# / Development

async void Swallows Exceptions

- 04.01.26 - ErcanOPAK comment on async void Swallows Exceptions

Errors disappear. Whyasync void cannot be awaited. Fix async Task MethodAsync()  

Read More
SQL

SQL Temp Tables Kill Performance

- 04.01.26 - ErcanOPAK comment on SQL Temp Tables Kill Performance

Works fine with small data. WhyTempDB contention. FixUse table variables for small datasets.

Read More
SQL

SQL Queries Return Wrong Results After Schema Change

- 04.01.26 - ErcanOPAK comment on SQL Queries Return Wrong Results After Schema Change

Data exists but isn’t returned. WhyImplicit joins break after column changes. Fix SELECT … FROM A INNER JOIN B ON A.Id = B.AId;  

Read More
Asp.Net Core

Dependency Injection Causes Memory Bloat

- 04.01.26 - ErcanOPAK comment on Dependency Injection Causes Memory Bloat

Memory grows over time. WhyTransient services holding unmanaged resources. FixDispose resources explicitly or use scoped lifetime.

Read More
Asp.Net Core / C#

ASP.NET Core Thread Pool Starves Under Load

- 04.01.26 - ErcanOPAK comment on ASP.NET Core Thread Pool Starves Under Load

Requests queue endlessly. WhyLong-running sync tasks block threads. Fix await Task.Run(LongRunningWork);  

Read More
Git

Git Hooks Break CI Unexpectedly

- 04.01.26 - ErcanOPAK comment on Git Hooks Break CI Unexpectedly

Local ok, CI fails. WhyHooks are not shared by default. FixDocument hooks or enforce via tooling.

Read More
Git

Git Reverts Remove the Wrong Code

- 04.01.26 - ErcanOPAK comment on Git Reverts Remove the Wrong Code

Undo makes things worse. WhyRevert order matters in merged branches. FixRevert merge commits carefully with parent selection.

Read More
Ajax / JavaScript

Ajax Calls Fail When Tab Is Backgrounded

- 04.01.26 - ErcanOPAK comment on Ajax Calls Fail When Tab Is Backgrounded

Works when tab is active. WhyBrowser throttles background requests. FixUse Background Sync or retry logic.

Read More
JavaScript

JavaScript State Updates Lag Behind UI

- 04.01.26 - ErcanOPAK comment on JavaScript State Updates Lag Behind UI

UI renders stale data. WhyState mutations are asynchronous. Fix setState(prev => ({ …prev, value }));  

Read More
HTML

HTML5 Video Controls Fail on iOS

- 04.01.26 - ErcanOPAK comment on HTML5 Video Controls Fail on iOS

Works on desktop. WhyiOS requires explicit attributes. Fix <video controls playsinline></video>  

Read More
CSS

CSS vh Breaks Mobile Layouts

- 04.01.26 - ErcanOPAK comment on CSS vh Breaks Mobile Layouts

Design jumps on scroll. WhyMobile browsers change viewport height dynamically. Fix height: 100dvh;  

Read More
Windows

USB Devices Randomly Disconnect

- 04.01.26 - ErcanOPAK comment on USB Devices Randomly Disconnect

No errors shown. WhySelective USB suspend. FixDisable USB power saving in device manager.

Read More
Windows

Windows 11 File Explorer Becomes Unusable

- 04.01.26 - ErcanOPAK comment on Windows 11 File Explorer Becomes Unusable

Explorer freezes randomly. WhyBroken shell extensions. FixDisable third-party shell extensions.

Read More
AI

AI Prompt — Learn Anything Faster

- 04.01.26 - ErcanOPAK comment on AI Prompt — Learn Anything Faster

Prompt Teach this topic using: – A simple analogy – A real-world example – A common misconception Topic: <INSERT TOPIC>  

Read More
AI

AI Prompt — Predict Failure Modes Before Production

- 04.01.26 - ErcanOPAK comment on AI Prompt — Predict Failure Modes Before Production

Prompt Act as a senior reliability engineer. Given this design: – Predict failure scenarios – Identify weakest assumptions – Suggest mitigation strategies Design: <DESCRIBE SYSTEM>  

Read More
AI

AI Prompt — Explain Why This Code Is Slow

- 04.01.26 - ErcanOPAK comment on AI Prompt — Explain Why This Code Is Slow

Prompt Analyze this code. Explain: – Time complexity – Memory allocation hotspots – Hidden blocking calls Suggest measurable improvements. Code: <PASTE CODE>  

Read More
Docker

Docker Containers Fail Only in Production

- 04.01.26 - ErcanOPAK comment on Docker Containers Fail Only in Production

Local works perfectly. WhyENV values differ from ARG during build vs runtime. FixUse ENV for runtime, ARG only for build.

Read More
Kubernetes

Kubernetes ConfigMap Changes Don’t Apply

- 04.01.26 - ErcanOPAK comment on Kubernetes ConfigMap Changes Don’t Apply

You updated config, app ignores it. WhyConfigMaps are not auto-reloaded. FixRestart pods or mount with checksum-based rollout.

Read More
Wordpress

WordPress REST Responses Cached Incorrectly

- 04.01.26 - ErcanOPAK comment on WordPress REST Responses Cached Incorrectly

Users see outdated data. WhyCaching plugins ignore REST headers. FixAdd explicit cache-control headers to REST responses.

Read More
Wordpress

WordPress Cron Jobs Never Run on Low-Traffic Sites

- 04.01.26 - ErcanOPAK comment on WordPress Cron Jobs Never Run on Low-Traffic Sites

Scheduled tasks silently fail. WhyWP-Cron depends on page visits. FixDisable WP-Cron and use a real system cron.

Read More
Photoshop

Photoshop Masks Become Impossible to Edit

- 04.01.26 - ErcanOPAK comment on Photoshop Masks Become Impossible to Edit

You can see them but can’t control them. WhyMasks nested inside smart objects stack up transformation matrices. FixApply transformations before masking.

Read More
Photoshop

Photoshop Images Cause CLS Issues on Websites

- 04.01.26 - ErcanOPAK comment on Photoshop Images Cause CLS Issues on Websites

Page jumps while loading. WhyExported images have no intrinsic size metadata. FixAlways define width/height in HTML or CSS after export.

Read More
Visual Studio

Visual Studio Shows No Errors but App Won’t Start

- 04.01.26 - ErcanOPAK comment on Visual Studio Shows No Errors but App Won’t Start

Build succeeds. Run does nothing. Why this happensStartup project is misaligned with the actual executable entry point. Why it mattersYou debug the wrong project for hours. FixExplicitly set the correct startup project and launch profile.

Read More
C#

DateTime.Now Breaks Distributed Logic

- 03.01.26 | 03.01.26 - ErcanOPAK comment on DateTime.Now Breaks Distributed Logic

Same code, different results. WhyLocal time zones and daylight saving. Fix DateTimeOffset.UtcNow   🔥 Why DateTime.Now Breaks Distributed Logic (And What to Use Instead) Same code. Different results.If you’ve ever seen time-based logic randomly fail in production, DateTime.Now might be the silent culprit. In distributed systems, local time is a trap. 🚨 The Core Problem […]

Read More
C#

LINQ Looks Clean but Allocates Heavily

- 03.01.26 - ErcanOPAK comment on LINQ Looks Clean but Allocates Heavily

Readable code, hidden cost. WhyMultiple enumerations. Fix var list = items.ToList();  

Read More
Page 43 of 69
« Previous 1 … 38 39 40 41 42 43 44 45 46 47 48 … 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 (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • 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 (447)

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 (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • 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