Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

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

Day: November 15, 2026

AI

The AI Prompt That Finds the One Config Flag Causing Weird Behavior

- 15.11.26 - ErcanOPAK comment on The AI Prompt That Finds the One Config Flag Causing Weird Behavior

πŸ€– The AI Prompt That Finds the One Config Flag Causing Weird Behavior When a behavior changes somewhere in a large configuration surface spread across appsettings files, environment variables, and feature-flag systems, and nobody remembers which exact flag is responsible, handing an AI assistant the full diff between a working and a broken configuration — […]

Read More
C#

C#: Fix a Struct’s IEquatable Implementation Being Bypassed

- 15.11.26 - ErcanOPAK comment on C#: Fix a Struct’s IEquatable Implementation Being Bypassed

πŸ”§ C#: Fix a Struct’s IEquatable Implementation Being Bypassed Implementing IEquatable<T> on a struct gives a fast, allocation-free Equals(T other) — but C# requires you to ALSO override the inherited object.Equals(object) and GetHashCode() yourself for that optimization to apply everywhere. Any code path that compares the struct through its boxed object form — a non-generic […]

Read More
Docker

Docker: Fix a .NET App Crashing Only on Alpine From Missing glibc

- 15.11.26 - ErcanOPAK comment on Docker: Fix a .NET App Crashing Only on Alpine From Missing glibc

🐳 Docker: Fix a .NET App Crashing Only on Alpine From Missing glibc Alpine-based images use musl libc instead of glibc. A .NET app that depends — directly, or through a native dependency like a database driver or an image-processing library shipping a native .so — on glibc-specific symbols runs perfectly on the Debian-based .NET […]

Read More
Kubernetes

Kubernetes: Fix ImagePullBackOff From a Misplaced Pull Secret

- 15.11.26 - ErcanOPAK comment on Kubernetes: Fix ImagePullBackOff From a Misplaced Pull Secret

☸️ Kubernetes: Fix ImagePullBackOff From a Misplaced Pull Secret Secrets — including an imagePullSecrets credential for a private registry — are namespace-scoped objects. Creating the pull secret in default because that’s what a quick-start guide showed does nothing for a Deployment actually running in staging, even though kubectl get secret against your current context clearly […]

Read More
C#

C#: Fix a Monitor Lock Held Across an await by the Wrong Thread

- 15.11.26 - ErcanOPAK comment on C#: Fix a Monitor Lock Held Across an await by the Wrong Thread

πŸ”§ C#: Fix a Monitor Lock Held Across an await by the Wrong Thread The compiler flatly refuses to let you write await directly inside a lock statement — a compile error that exists specifically to prevent a real deadlock risk. Working around it by manually calling Monitor.Enter/Monitor.Exit instead compiles fine, because Monitor has no […]

Read More
Photoshop

Photoshop: Fix a Color Halo Left Behind After Select and Mask

- 15.11.26 - ErcanOPAK comment on Photoshop: Fix a Color Halo Left Behind After Select and Mask

πŸ–ŒοΈ Photoshop: Fix a Color Halo Left Behind After Select and Mask Cutting a subject out with fine detail — hair, fur, fuzzy edges — through the Select and Mask workspace leaves a thin ring of partially transparent edge pixels that are still a color blend between the subject and its ORIGINAL background. Drop that […]

Read More
AI

The AI Prompt That Packs Your Suitcase by Checking the Weather First

- 15.11.26 - ErcanOPAK comment on The AI Prompt That Packs Your Suitcase by Checking the Weather First

πŸ€– The AI Prompt That Packs Your Suitcase by Checking the Weather First A packing list built from “it’s summer there” ignores how much a single week’s actual weather and your specific schedule can vary. Giving an AI assistant your destination, exact travel dates, and a list of planned activities — and asking it to […]

Read More
C#

C#: Fix a Static Dictionary Race During Lazy First Access

- 15.11.26 - ErcanOPAK comment on C#: Fix a Static Dictionary Race During Lazy First Access

πŸ”§ C#: Fix a Static Dictionary Race During Lazy First Access A DIY “lazy singleton” — a static Dictionary field left null and populated on first use with a plain null check — looks harmless in single-threaded code. Under real concurrent load, two threads can both observe the field as null at nearly the same […]

Read More
SQL

SQL Server: Fix TRY_CONVERT Hiding Bad Dates Instead of Erroring

- 15.11.26 - ErcanOPAK comment on SQL Server: Fix TRY_CONVERT Hiding Bad Dates Instead of Erroring

πŸ—„οΈ SQL Server: Fix TRY_CONVERT Hiding Bad Dates Instead of Erroring TRY_CONVERT is designed to return NULL instead of throwing when a conversion fails — useful for intentionally tolerant parsing. Used on an untrusted or dirty data source, though, a genuinely malformed date string and a legitimately missing source value become completely indistinguishable in the […]

Read More
AI

The AI Prompt That Spots a Silent Fallback Hiding a Failed Call

- 15.11.26 - ErcanOPAK comment on The AI Prompt That Spots a Silent Fallback Hiding a Failed Call

πŸ€– The AI Prompt That Spots a Silent Fallback Hiding a Failed Call A try/catch around an external call that falls back to a cached or default value on failure is a reasonable resilience pattern — right up until the external dependency has been down for days while the app keeps serving stale data looking […]

Read More
HTML

HTML5: Fix a Native dialog Losing Focus Return to Its Button

- 15.11.26 - ErcanOPAK comment on HTML5: Fix a Native dialog Losing Focus Return to Its Button

🧩 HTML5: Fix a Native dialog Losing Focus Return to Its Button A native <dialog> opened with showModal() remembers and restores focus to whatever element triggered it — but only when the dialog closes through its own default mechanisms, like the Esc key or a <form method=”dialog”> submission. Close it programmatically from your own JavaScript […]

Read More
SQL

SQL Server: Fix Two Equal-Looking DATETIME Values Failing to Match

- 15.11.26 - ErcanOPAK comment on SQL Server: Fix Two Equal-Looking DATETIME Values Failing to Match

πŸ—„οΈ SQL Server: Fix Two Equal-Looking DATETIME Values Failing to Match Legacy DATETIME stores time internally in increments of roughly 3.33 milliseconds and rounds any value to the nearest one of those increments. A value computed once and stored, then later recomputed independently elsewhere — from .NET DateTime logic with far finer tick precision — […]

Read More
CSS

CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box

- 15.11.26 - ErcanOPAK comment on CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box

🎨 CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box Sticky positioning computes “stuck” relative to the element’s nearest scrolling ancestor. If any ancestor between the sticky element and that scroll container has overflow set to anything other than visible — including overflow-x or overflow-y alone, added for an entirely unrelated reason like […]

Read More
Photoshop

Photoshop: Fix Blurry Text After Scaling Up a Smart Object

- 15.11.26 - ErcanOPAK comment on Photoshop: Fix Blurry Text After Scaling Up a Smart Object

πŸ–ŒοΈ Photoshop: Fix Blurry Text After Scaling Up a Smart Object A Type layer is vector — it renders fresh from its outlines at whatever size you need, always crisp. The moment it gets rasterized into pixels (directly, or by being flattened into a Smart Object after rasterizing) and that Smart Object is later scaled […]

Read More
Asp.Net Core

Asp.Net Core: Fix Large Uploads Failing Only on IIS, Not Locally

- 15.11.26 - ErcanOPAK comment on Asp.Net Core: Fix Large Uploads Failing Only on IIS, Not Locally

βš™οΈ Asp.Net Core: Fix Large Uploads Failing Only on IIS, Not Locally Kestrel enforces its own request-body-size limit, MaxRequestBodySize, defaulting to roughly 30MB, which you can raise in code. Host the app behind IIS through the ASP.NET Core Module, and IIS enforces an entirely separate limit of its own in web.config — requestLimits/maxAllowedContentLength, also defaulting […]

Read More
Visual Studio

Visual Studio: Fix Attach to Process Hiding Another User’s Service

- 15.11.26 - ErcanOPAK comment on Visual Studio: Fix Attach to Process Hiding Another User’s Service

πŸ› οΈ Visual Studio: Fix Attach to Process Hiding Another User’s Service The Attach to Process dialog, by default, only lists processes visible to and owned by your current Windows user account. A Windows Service running under a different logon account — LocalSystem, NetworkService, or a dedicated service account — sits at a different privilege level […]

Read More
JavaScript

JavaScript: Fix a WeakMap Entry Disappearing Before You Expected

- 15.11.26 - ErcanOPAK comment on JavaScript: Fix a WeakMap Entry Disappearing Before You Expected

⚑ JavaScript: Fix a WeakMap Entry Disappearing Before You Expected A WeakMap holds its keys weakly, meaning an entry can be garbage collected — and silently vanish from the map — as soon as nothing else in the program holds a strong reference to that key object. Code that assumes “the DOM node is still […]

Read More
Git

Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It

- 15.11.26 - ErcanOPAK comment on Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It

πŸ”€ Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It git stash pop applies the stash and deletes it from the stash list ONLY if the apply succeeds cleanly. If the pop hits a merge conflict, Git intentionally leaves the stash entry in the list — a safety net so you don’t lose […]

Read More
Wordpress

WordPress: Fix the Block Editor Freezing on Reusable-Heavy Posts

- 15.11.26 - ErcanOPAK comment on WordPress: Fix the Block Editor Freezing on Reusable-Heavy Posts

πŸ“ WordPress: Fix the Block Editor Freezing on Reusable-Heavy Posts Gutenberg re-validates every reusable block’s saved markup against its current block definition on every autosave cycle, to detect whether the block’s output has drifted from what the block type now expects. A post that references a whole library of small reusable blocks — separate CTA, […]

Read More
Wordpress

WordPress: Fix Regenerated Thumbnails Not Updating Old Posts

- 15.11.26 - ErcanOPAK comment on WordPress: Fix Regenerated Thumbnails Not Updating Old Posts

πŸ“ WordPress: Fix Regenerated Thumbnails Not Updating Old Posts A “Regenerate Thumbnails” run recreates the image FILES at each registered size and updates the attachment’s own metadata, so anything that reads that metadata at render time — like the block editor’s Image block, which stores only the attachment ID and a size slug — picks […]

Read More
Asp.Net Core

Asp.Net Core: Fix a Background Loop Leaking a New DI Scope Every Pass

- 15.11.26 - ErcanOPAK comment on Asp.Net Core: Fix a Background Loop Leaking a New DI Scope Every Pass

βš™οΈ Asp.Net Core: Fix a Background Loop Leaking a New DI Scope Every Pass A BackgroundService loop that needs scoped services, like a DbContext, correctly creates a new scope per iteration via IServiceScopeFactory.CreateScope() — scoped services shouldn’t outlive one unit of work. But if that scope isn’t disposed on every single pass, which is easy […]

Read More
Windows

Windows 11: Fix a Right-Click Menu Taking Forever to Open

- 15.11.26 - ErcanOPAK comment on Windows 11: Fix a Right-Click Menu Taking Forever to Open

πŸͺŸ Windows 11: Fix a Right-Click Menu Taking Forever to Open The right-click context menu is built by querying every registered shell extension — icon overlays, cloud-storage integrations, archive tools, antivirus “scan with…” entries — synchronously before the menu can even display. One slow or hanging extension, like a cloud sync client checking file status […]

Read More
Ajax

Ajax: Fix multipart Uploads Failing From a Manual Content-Type

- 15.11.26 - ErcanOPAK comment on Ajax: Fix multipart Uploads Failing From a Manual Content-Type

πŸ”„ Ajax: Fix multipart Uploads Failing From a Manual Content-Type A FormData-based file upload needs a multipart/form-data Content-Type header that includes a unique boundary string separating each field and file — the browser generates and sets that header automatically when you let it. Manually setting Content-Type: multipart/form-data yourself, often copied from JSON-API helper code, overrides […]

Read More
Windows

Windows 11: Fix the Default Printer Switching Back on Its Own

- 15.11.26 - ErcanOPAK comment on Windows 11: Fix the Default Printer Switching Back on Its Own

πŸͺŸ Windows 11: Fix the Default Printer Switching Back on Its Own “Let Windows manage my default printer” (Settings > Bluetooth & devices > Printers & scanners) automatically switches the default printer to whichever one was most recently used at your current network location. A user who manually sets a different default — preferring a […]

Read More
Git

Git: Fix .gitattributes Quietly Rewriting Old Line Endings

- 15.11.26 - ErcanOPAK comment on Git: Fix .gitattributes Quietly Rewriting Old Line Endings

πŸ”€ Git: Fix .gitattributes Quietly Rewriting Old Line Endings A .gitattributes text-normalization rule, like * text=auto, only applies its conversion the next time Git actually touches a file’s content — typically on checkout or re-add — never retroactively to blobs already committed with different line endings. Add the rule to an existing repo, and every […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

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

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (976)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (853)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

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