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

Day: October 3, 2026

Asp.Net Core

ASP.NET Core: Fix a Request That Fails With 415 Unsupported Media Type Because the Client Forgot a Content-Type Header

- 03.10.26 - ErcanOPAK comment on ASP.NET Core: Fix a Request That Fails With 415 Unsupported Media Type Because the Client Forgot a Content-Type Header

βš™οΈ The API Call That Had a Perfectly Valid Body and Still Got Rejected ASP.NET Core’s model binding doesn’t inspect the body of a request to guess what format it’s in – it trusts the Content-Type header the client sent, and picks an input formatter based on that header alone. A request with a flawless, […]

Read More
C#

C#: Fix a Task.WhenAll Call That Silently Swallows All but One Exception When Multiple Tasks Fail

- 03.10.26 - ErcanOPAK comment on C#: Fix a Task.WhenAll Call That Silently Swallows All but One Exception When Multiple Tasks Fail

πŸ”§ The Task.WhenAll That Only Ever Told You About One Failure Task.WhenAll is built to run several tasks concurrently and complete once they’re all done, and if more than one of them faults, it faithfully stores every exception on the returned Task’s AggregateException. The trap is in how you usually read the result: awaiting that […]

Read More
Ajax

Ajax: Fix a GET Request That Silently Returns a Stale Cached Response Instead of Hitting the Server

- 03.10.26 - ErcanOPAK comment on Ajax: Fix a GET Request That Silently Returns a Stale Cached Response Instead of Hitting the Server

πŸ”„ The GET Request That Kept Answering From Yesterday A plain fetch() GET request is, by design, eligible for the browser’s standard HTTP cache the same way a static image or script would be, and if the server’s response included cache-friendly headers (or didn’t explicitly forbid caching), the browser is within its rights to serve […]

Read More
HTML

HTML5: Fix a File Input That Refuses to Let You Pick the Same File Twice After an Upload Fails

- 03.10.26 - ErcanOPAK comment on HTML5: Fix a File Input That Refuses to Let You Pick the Same File Twice After an Upload Fails

🧩 The File Picker That Remembered a File It Should Have Forgotten A change event on a file input only fires when its value is different from what it already was, and the browser considers selecting the exact same file from the exact same path as ‘no change’ – the input’s internal value never actually […]

Read More
Photoshop

Photoshop: Fix Guides That Go Missing Every Time a File Is Shared by a Teammate

- 03.10.26 - ErcanOPAK comment on Photoshop: Fix Guides That Go Missing Every Time a File Is Shared by a Teammate

πŸ–ŒοΈ The Guides That Only Ever Existed on One Machine Guides placed manually in Photoshop are, by default, stored as part of that specific document’s saved state, which should mean they travel with the PSD file wherever it goes – but a surprising number of workflows strip them out along the way without anyone intending […]

Read More
JavaScript

JavaScript: Why JSON.stringify Silently Drops undefined Values, Functions, and Symbols From an Object

- 03.10.26 - ErcanOPAK comment on JavaScript: Why JSON.stringify Silently Drops undefined Values, Functions, and Symbols From an Object

⚑ The Object Property That Disappeared on the Way to JSON JSON has no representation for undefined, functions, or symbols – the format simply doesn’t define a way to encode them – so JSON.stringify doesn’t throw or warn when it encounters one, it just leaves the corresponding key out of the output entirely. A property […]

Read More
AI

The AI Prompt That Strengthens a Weak Performance Review With Specific, Defensible Examples

- 03.10.26 - ErcanOPAK comment on The AI Prompt That Strengthens a Weak Performance Review With Specific, Defensible Examples

πŸ€– The Prompt That Turns ‘Great Team Player’ Into Something You Can Actually Defend A performance review written in a hurry tends to lean on vague, generically positive phrases – ‘strong communicator,’ ‘great attitude,’ ‘goes above and beyond’ – that feel supportive in the moment but fall apart the second someone asks for a concrete […]

Read More
Kubernetes

Kubernetes: Fix an Init Container That Silently Blocks the Main Container From Ever Starting

- 03.10.26 - ErcanOPAK comment on Kubernetes: Fix an Init Container That Silently Blocks the Main Container From Ever Starting

☸️ The Pod That Was Technically Running and Never Actually Doing Anything Init containers are designed to run to completion, in order, before any of a pod’s main containers start – which is exactly the right model for setup work like waiting on a dependency or seeding a config file, but becomes a silent trap […]

Read More
AI

The AI Prompt That Catches Missing ConfigureAwait Calls and Sync-Over-Async Deadlocks Hiding in Your C# Codebase

- 03.10.26 - ErcanOPAK comment on The AI Prompt That Catches Missing ConfigureAwait Calls and Sync-Over-Async Deadlocks Hiding in Your C# Codebase

πŸ€– The Prompt That Reads Your Async Code the Way a Deadlock Eventually Would Missing ConfigureAwait(false) calls in library code, and synchronous blocking on an async call with .Result or .Wait(), are two of the most common causes of hard-to-reproduce deadlocks in .NET – and both are easy for a human reviewer to skim right […]

Read More
Asp.Net Core

ASP.NET Core: Why an IOptionsSnapshot Injected Into a Singleton Silently Freezes on Its First Configuration Value Forever

- 03.10.26 - ErcanOPAK comment on ASP.NET Core: Why an IOptionsSnapshot Injected Into a Singleton Silently Freezes on Its First Configuration Value Forever

βš™οΈ The Configuration Reload That Never Reached the Singleton IOptionsSnapshot exists specifically to give you a fresh configuration value on every scoped lifetime – typically once per request – which makes it the obvious choice when you want config changes to apply without restarting the app. The catch is that IOptionsSnapshot is itself registered as […]

Read More
Wordpress

WordPress: Fix a Caching Plugin That Keeps Serving an Outdated robots.txt to Search Engines

- 03.10.26 - ErcanOPAK comment on WordPress: Fix a Caching Plugin That Keeps Serving an Outdated robots.txt to Search Engines

πŸ“ The robots.txt File That Search Engines Kept Reading From the Past WordPress generates a virtual robots.txt on the fly by default, assembling it from site settings each time it’s requested, which works fine until a full-page caching plugin or a server-level cache layer decides that response is cacheable and stores a copy of it […]

Read More
CSS

CSS: Fix a Grid Item That Overflows Its Column Because of a Missing minmax(0, 1fr)

- 03.10.26 - ErcanOPAK comment on CSS: Fix a Grid Item That Overflows Its Column Because of a Missing minmax(0, 1fr)

🎨 The Grid Column That Grew to Fit Content It Was Supposed to Contain A fr unit distributes available space among grid tracks, but it doesn’t override each track’s minimum size, and the default minimum width for a grid item is auto – which effectively means ‘at least as wide as my content needs to […]

Read More
Photoshop

Photoshop: Fix an Adjustment Layer That Silently Affects Every Layer Below It Instead of Just the One You Clipped It To

- 03.10.26 - ErcanOPAK comment on Photoshop: Fix an Adjustment Layer That Silently Affects Every Layer Below It Instead of Just the One You Clipped It To

πŸ–ŒοΈ The Color Correction That Leaked Into Every Layer Underneath An adjustment layer, by default, affects every layer stacked beneath it in the document – that’s the whole point of using one instead of editing pixels directly, since it applies non-destructively to the combined result below. Clipping it to a single layer (so it only […]

Read More
C#

C#: Why Calling Count() Instead of Any() Silently Enumerates an Entire Sequence Just to Check If It’s Empty

- 03.10.26 - ErcanOPAK comment on C#: Why Calling Count() Instead of Any() Silently Enumerates an Entire Sequence Just to Check If It’s Empty

πŸ”§ The Emptiness Check That Walked the Whole List Anyway Count() and Any() both answer questions about a sequence, but they don’t cost the same thing. Any() asks a yes/no question and can stop at the very first element that satisfies it. Count() has to produce an exact number, which means walking every single element […]

Read More
Visual Studio

Visual Studio: Fix a Solution Configuration Dropdown That Silently Reverts From Release Back to Debug

- 03.10.26 - ErcanOPAK comment on Visual Studio: Fix a Solution Configuration Dropdown That Silently Reverts From Release Back to Debug

πŸ› οΈ The Build Configuration That Kept Undoing Itself Visual Studio’s Solution Configuration dropdown is meant to be a simple, sticky choice – pick Release, and every subsequent build should use it until you change it again. In practice, several common actions quietly override that choice without any confirmation dialog: opening certain project types (especially ones […]

Read More
Wordpress

WordPress: Fix Child Theme Styles That Silently Stop Overriding the Parent Theme After a Core Update

- 03.10.26 - ErcanOPAK comment on WordPress: Fix Child Theme Styles That Silently Stop Overriding the Parent Theme After a Core Update

πŸ“ The Child Theme Styles That the Parent Quietly Started Winning Against A child theme’s style.css is supposed to load after the parent theme’s, which is the entire mechanism that lets its rules override the parent’s defaults – but that ordering depends on the child theme correctly enqueuing the parent’s stylesheet as its own dependency […]

Read More
AI

The AI Prompt That Spots N+1 Query Patterns Hiding Inside Your ORM Code

- 03.10.26 - ErcanOPAK comment on The AI Prompt That Spots N+1 Query Patterns Hiding Inside Your ORM Code

πŸ€– The Prompt That Counts Queries the Way Your Database Would An N+1 query bug happens when code loads a list of records with one query, then loops over that list making a separate query per item to fetch related data – a pattern that runs fine with five test rows and falls over with […]

Read More
SQL

SQL Server: Fix a Filtered Index That Gets Silently Ignored Because the Query’s WHERE Clause Doesn’t Match It Exactly

- 03.10.26 - ErcanOPAK comment on SQL Server: Fix a Filtered Index That Gets Silently Ignored Because the Query’s WHERE Clause Doesn’t Match It Exactly

πŸ—„οΈ The Filtered Index That Was Never Actually Considered A filtered index narrows an index down to the rows that matter – active orders, non-null email addresses, a specific status – which keeps it small and fast for the queries that only ever care about that subset. The optimizer will only use it, though, when […]

Read More
Git

Git: Fix a Sparse Checkout That Silently Hides Files You Expect to See in Your Working Directory

- 03.10.26 - ErcanOPAK comment on Git: Fix a Sparse Checkout That Silently Hides Files You Expect to See in Your Working Directory

πŸ”€ The Files That Were Committed, Tracked, and Nowhere in Sight Sparse checkout lets a large repository check out only a subset of its directory tree into the working copy, which is genuinely useful on monorepos where nobody needs every folder on disk at once. The trouble is that a sparse-checkout pattern set up for […]

Read More
Docker

Docker: Fix an ENTRYPOINT and CMD Combination That Silently Ignores Arguments Passed at docker run

- 03.10.26 - ErcanOPAK comment on Docker: Fix an ENTRYPOINT and CMD Combination That Silently Ignores Arguments Passed at docker run

🐳 The Container That Never Heard a Word You Typed After the Image Name ENTRYPOINT and CMD are meant to work together – ENTRYPOINT defines the fixed program that always runs, and CMD supplies default arguments to it that anyone can override by appending their own at the end of docker run. That handoff only […]

Read More
Git

Git: Recover a Commit Lost After an Interactive Rebase Accidentally Drops It

- 03.10.26 - ErcanOPAK comment on Git: Recover a Commit Lost After an Interactive Rebase Accidentally Drops It

πŸ”€ The Commit That Vanished From an Interactive Rebase Without a Trace An interactive rebase lets you reorder, squash, reword, and drop commits by editing a simple todo list before Git replays them one by one – which is exactly what makes it easy to delete the wrong line, or change pick to drop on […]

Read More
Windows

Windows 11: Fix a Microphone Other People Can’t Hear Even Though Your Own Input Meter Looks Fine

- 03.10.26 - ErcanOPAK comment on Windows 11: Fix a Microphone Other People Can’t Hear Even Though Your Own Input Meter Looks Fine

πŸͺŸ The Microphone That Only Worked for Windows Itself Windows 11’s Sound settings page shows a live input meter that reacts to a microphone picking up audio at the driver level, which only confirms that the operating system itself is receiving a signal – it says nothing about whether the specific app you’re using has […]

Read More
SQL

SQL Server: Why a GUID Primary Key Fragments a Table Far Faster Than an Identity Column Ever Would

- 03.10.26 - ErcanOPAK comment on SQL Server: Why a GUID Primary Key Fragments a Table Far Faster Than an Identity Column Ever Would

πŸ—„οΈ The Primary Key That Scattered Every New Row Across the Whole Table A clustered index physically orders the table’s data pages to match the key, which is cheap to maintain when new values always sort to the end – an IDENTITY column does exactly that, so every insert simply appends a new row to […]

Read More
C#

C#: Why a ThreadStatic Field Quietly Loses Its Value the Moment an async Method Resumes on a Different Thread

- 03.10.26 - ErcanOPAK comment on C#: Why a ThreadStatic Field Quietly Loses Its Value the Moment an async Method Resumes on a Different Thread

πŸ”§ The ThreadStatic Field That Forgot Everything After One Await A [ThreadStatic] field gives every thread its own private copy of a value, which makes it a tempting way to stash per-operation context like a correlation ID or a current user without threading a parameter through every method call. That guarantee is tied to the […]

Read More
Windows

Windows 11: Fix a Dual-Boot Menu That Vanishes the Next Time Windows Installs a Cumulative Update

- 03.10.26 - ErcanOPAK comment on Windows 11: Fix a Dual-Boot Menu That Vanishes the Next Time Windows Installs a Cumulative Update

πŸͺŸ The Boot Menu That a Windows Update Quietly Erased A dual-boot setup works by having the Windows Boot Manager present a menu that points at more than one operating system entry, and Windows considers that boot configuration entirely its own to manage. A cumulative update that touches the boot loader – which happens more […]

Read More
Asp.Net Core

ASP.NET Core: Fix a Minimal API Action That Receives null Because It Expects an Object but the Client Sent a JSON Array

- 03.10.26 - ErcanOPAK comment on ASP.NET Core: Fix a Minimal API Action That Receives null Because It Expects an Object but the Client Sent a JSON Array

πŸ”§ The Request Body That Bound to null Because It Was the Wrong Shape Minimal API model binding reads the request body and tries to deserialize it directly into whatever parameter type the endpoint declared. When a client sends a JSON object and the parameter is a record expecting one, this is seamless. When a […]

Read More
JavaScript

JavaScript: Fix a Promise.race() Call Whose Losing Promises Keep Running in the Background After It Resolves

- 03.10.26 - ErcanOPAK comment on JavaScript: Fix a Promise.race() Call Whose Losing Promises Keep Running in the Background After It Resolves

πŸ”§ The Promise.race() Winner That Didn’t Actually Stop Anything Promise.race() settles as soon as the first of several promises settles, and returns that result – but it has no way to reach into the other promises and stop them, because a JavaScript Promise has no built-in cancellation mechanism at all. A promise that ‘loses’ the […]

Read More
C#

C#: Why an Interface’s Default Method Only Runs When You Call It Through the Interface, Not Through the Class

- 03.10.26 - ErcanOPAK comment on C#: Why an Interface’s Default Method Only Runs When You Call It Through the Interface, Not Through the Class

πŸ”§ The Default Interface Method That Only Worked Through One Door A default interface method was added specifically so an interface could grow a new member without breaking every class that already implements it – any class that doesn’t override the member simply falls back to the body written on the interface itself. What catches […]

Read More
Ajax

Ajax: Fix a fetch() Call That Silently Succeeds With a 404 Page’s HTML Instead of Throwing an Error

- 03.10.26 - ErcanOPAK comment on Ajax: Fix a fetch() Call That Silently Succeeds With a 404 Page’s HTML Instead of Throwing an Error

πŸ”§ The fetch() Call That Treated a 404 Page Like a Perfectly Good Response fetch()’s Promise only rejects for a genuine network-level failure – a dropped connection, a DNS failure, a request that never reached a server at all. An HTTP error status returned by a server that was reached successfully, whether that’s a 404, […]

Read More
CSS

CSS: Why a Pinned Overlay Starts Scrolling With the Page the Moment a Parent Element Gets Any transform

- 03.10.26 - ErcanOPAK comment on CSS: Why a Pinned Overlay Starts Scrolling With the Page the Moment a Parent Element Gets Any transform

πŸ”§ The Pinned Overlay That Started Scrolling Away With Everything Else position: fixed is specified to position an element relative to the viewport – until an ancestor somewhere between it and the document root has a transform, a filter, or a few other specific properties applied, any one of which creates a new containing block […]

Read More
Page 1 of 3
1 2 3 Next Β»

Posts pagination

1 2 3 Next »
October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Sep    

Most Viewed Posts

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

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps
  • Photoshop: Fix a Color Profile Mismatch That Makes Printed Output Look Nothing Like What You Saw On Screen
  • WordPress: Fix Search Results That Return Pages From a Theme You Deactivated Months Ago
  • Visual Studio: Fix a Test Project That Builds Fine Alone but Fails to Discover Any Tests After a NuGet Restore
  • ASP.NET Core: Fix a File Upload That Times Out on Slow Connections Only Because Kestrel’s Minimum Data Rate Feature Kicked In
  • JavaScript: Fix an Array Destructuring Default Value That Silently Never Applies Because null Was Passed Instead of Undefined

Most Viewed Posts

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

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps

Social

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