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

Month: September 2026

Photoshop

Photoshop: Recover a Saved Path That Vanishes From the Paths Panel After a Crash

- 27.09.26 - ErcanOPAK comment on Photoshop: Recover a Saved Path That Vanishes From the Paths Panel After a Crash

πŸ–ŒοΈ The Path That Was Definitely Saved and Wasn’t There After the Crash A named, saved path in the Paths panel is meant to persist with the document exactly like a layer would – but a path created and named in a work session that ends in a crash (rather than an explicit save) can […]

Read More
Git

Git: Fix a Commit That Silently Includes Leftover Files From a Failed Merge

- 27.09.26 - ErcanOPAK comment on Git: Fix a Commit That Silently Includes Leftover Files From a Failed Merge

πŸ”€ The Commit That Carried Along a Merge That Never Actually Finished Aborting a merge with git merge –abort cleanly resets tracked files back to their pre-merge state, but it does nothing about files the merge process itself created and left sitting in the working directory as untracked or partially-staged content – a generated file, […]

Read More
Asp.Net Core

ASP.NET Core: Fix a Swagger Document That Silently Omits an Endpoint From the Generated Spec

- 27.09.26 - ErcanOPAK comment on ASP.NET Core: Fix a Swagger Document That Silently Omits an Endpoint From the Generated Spec

βš™οΈ The Endpoint That Worked Perfectly and Never Showed Up in Swagger An endpoint can be fully functional – reachable, correctly routed, returning the right data – and still be completely absent from the generated Swagger/OpenAPI document, because Swashbuckle (and similar generators) build that document by reflecting over controller actions using rules of their own, […]

Read More
Photoshop

Photoshop: Fix a Smart Filter That Reapplies With the Wrong Settings After Reopening a File

- 27.09.26 - ErcanOPAK comment on Photoshop: Fix a Smart Filter That Reapplies With the Wrong Settings After Reopening a File

πŸ–ŒοΈ The Smart Filter That Remembered a Different Version of Itself A Smart Filter applied to a Smart Object is meant to stay fully editable and reproducible – reopening the file later should show the exact same filter with the exact same settings as when it was last saved. But a filter whose settings depend […]

Read More
Visual Studio

Visual Studio: Fix a Startup Project Setting That Keeps Reverting on Its Own

- 27.09.26 - ErcanOPAK comment on Visual Studio: Fix a Startup Project Setting That Keeps Reverting on Its Own

πŸ› οΈ The Startup Project That Wouldn’t Stay Set Setting a specific project as the startup project in a multi-project solution (right-click > Set as Startup Project) feels like a permanent, solution-level choice – but in solutions using newer, SDK-style project formats, that setting is stored in the .sln file itself, and certain workflows (switching git […]

Read More
HTML

HTML5: Fix a Progress Element That Renders but Never Visually Updates

- 27.09.26 - ErcanOPAK comment on HTML5: Fix a Progress Element That Renders but Never Visually Updates

🧩 The Progress Bar That Was Technically Updating the Whole Time Setting a native element’s value property via JavaScript updates its underlying state correctly and immediately – but on several browser/OS rendering combinations, the element’s VISUAL appearance doesn’t repaint in sync with rapid, frequent value changes unless the browser is given a moment to actually […]

Read More
Asp.Net Core

ASP.NET Core: Why Endpoint Routing Matches the Wrong Action When Two Routes Overlap

- 27.09.26 - ErcanOPAK comment on ASP.NET Core: Why Endpoint Routing Matches the Wrong Action When Two Routes Overlap

βš™οΈ The Route That Matched, Just Not the One That Was Meant Two route templates that overlap for a specific URL – a static segment in one competing with a parameterized segment in the other, at the same position – can resolve to whichever action ASP.NET Core’s routing considers more specific by its own precedence […]

Read More
C#

C#: Fix a Tuple Deconstruction That Silently Swaps Two Values of the Same Type

- 27.09.26 - ErcanOPAK comment on C#: Fix a Tuple Deconstruction That Silently Swaps Two Values of the Same Type

πŸ”§ The Deconstruction That Compiled Perfectly and Swapped Two Values Deconstructing a tuple into named variables binds each variable purely by POSITION, not by any name or meaning attached to the value – so when two values in a tuple share the same type (two decimals, two strings, two ints), writing the target variables in […]

Read More
Git

Git: Recover a Tag Deleted by Accident Before Anyone Else Had Cloned It

- 27.09.26 - ErcanOPAK comment on Git: Recover a Tag Deleted by Accident Before Anyone Else Had Cloned It

πŸ”€ The Tag That Got Deleted Before It Ever Left the Machine Deleting a git tag locally (git tag -d) before ever pushing it feels like it should be completely unrecoverable the moment it’s gone from git tag -l – but a tag, like any other git ref, is just a pointer to a specific […]

Read More
Ajax

Ajax: Fix a Request Queue That Processes Responses Out of the Order They Were Sent

- 27.09.26 - ErcanOPAK comment on Ajax: Fix a Request Queue That Processes Responses Out of the Order They Were Sent

πŸ”„ The Queue That Sent Requests in Order and Displayed Them However They Arrived Firing off a sequence of AJAX requests in a specific, deliberate order – save step 1, then step 2, then step 3 – guarantees nothing at all about the order their RESPONSES arrive back in, since each request travels independently and […]

Read More
Wordpress

WordPress: Fix a Custom Post Type That Disappears From the Admin Menu After an Update

- 27.09.26 - ErcanOPAK comment on WordPress: Fix a Custom Post Type That Disappears From the Admin Menu After an Update

πŸ“ The Post Type That Was Still There, Just Not Visible to Anyone A custom post type that vanishes from the WordPress admin menu after a plugin or theme update almost always still exists in the database, with all its content completely intact – what actually broke is the register_post_type() call itself, most commonly because […]

Read More
C#

C#: Why a Sealed Override Still Gets Hidden by a Subclass Using the new Keyword

- 27.09.26 - ErcanOPAK comment on C#: Why a Sealed Override Still Gets Hidden by a Subclass Using the new Keyword

πŸ”§ The Sealed Method That Wasn’t as Locked Down as It Looked Marking an override as sealed is meant to stop any further class in the hierarchy from changing its behavior through polymorphism – and it genuinely does prevent another override. But it does nothing to stop a subclass from declaring a brand-new method with […]

Read More
Windows

Windows 11: Fix a Laptop That Refuses to Charge Past a Fixed Percentage

- 27.09.26 - ErcanOPAK comment on Windows 11: Fix a Laptop That Refuses to Charge Past a Fixed Percentage

πŸͺŸ The Laptop That Stopped Charging at Exactly 80% Every Time A laptop that consistently stops charging at the same fixed percentage – not gradually declining battery health, but a hard ceiling that repeats reliably every single charge cycle – is very often not a battery fault at all, but a battery-longevity feature (commonly called […]

Read More
Kubernetes

Kubernetes: Fix a NetworkPolicy That Silently Blocks Traffic You Meant to Allow

- 27.09.26 - ErcanOPAK comment on Kubernetes: Fix a NetworkPolicy That Silently Blocks Traffic You Meant to Allow

☸️ The NetworkPolicy That Allowed Exactly What It Said and Nothing Else The moment a single NetworkPolicy selects a given pod, Kubernetes switches that pod’s networking from ‘allow everything by default’ to ‘deny everything except what’s explicitly allowed’ – which means adding one narrowly-scoped policy (meant only to restrict traffic FROM a specific source) can […]

Read More
C#

C#: Fix a Null-Forgiving Operator That’s Hiding a Genuine Null Reference Bug

- 27.09.26 - ErcanOPAK comment on C#: Fix a Null-Forgiving Operator That’s Hiding a Genuine Null Reference Bug

πŸ”§ The Exclamation Point That Made a Real Bug Go Quiet Nullable reference types are meant to surface exactly the kind of bug where a value that CAN be null is used as though it can’t be – and the null-forgiving operator (!) exists as an escape hatch for the cases where a developer genuinely […]

Read More
Windows

Windows 11: Fix a Keyboard Layout That Randomly Switches Mid-Typing

- 27.09.26 - ErcanOPAK comment on Windows 11: Fix a Keyboard Layout That Randomly Switches Mid-Typing

πŸͺŸ The Keyboard That Decided Mid-Sentence to Speak a Different Language Windows 11’s default keyboard shortcut for switching between installed input languages/layouts (Windows key + Space, or the older Alt + Shift) can trigger completely by accident during normal fast typing or gaming, especially on layouts where those key combinations overlap with commonly-used application shortcuts […]

Read More
SQL

SQL Server: Fix a Query Slowdown That Only Appears After the Table Crosses a Row-Count Threshold

- 27.09.26 - ErcanOPAK comment on SQL Server: Fix a Query Slowdown That Only Appears After the Table Crosses a Row-Count Threshold

πŸ—„οΈ The Query That Ran Fine for Months and Then Suddenly Didn’t A query that performs well for a long time and then degrades sharply, with no code change involved at all, is very often explained by the query optimizer switching strategies once a table’s row count crosses an internal threshold – a plan that […]

Read More
Docker

Docker: Fix a Health Check That Passes Locally but Always Fails Inside Compose

- 27.09.26 - ErcanOPAK comment on Docker: Fix a Health Check That Passes Locally but Always Fails Inside Compose

🐳 The Health Check That Passed Every Time by Hand and Failed Every Time in Compose A health check command that works perfectly when run manually inside a running container (via docker exec) can still fail consistently when Docker Compose runs that exact same command automatically – most often because the tool the health check […]

Read More
JavaScript

JavaScript: Why indexOf Can’t Find a NaN You Just Pushed Into the Array

- 27.09.26 - ErcanOPAK comment on JavaScript: Why indexOf Can’t Find a NaN You Just Pushed Into the Array

⚑ The Value That Was Right There in the Array and indexOf Still Couldn’t Find It Array.prototype.indexOf (and lastIndexOf) use strict equality (===) internally to compare values – and NaN, famously, is never strictly equal to anything, including itself. That means myArray.indexOf(NaN) returns -1 even when NaN is genuinely, visibly sitting in the array at […]

Read More
AI

The AI Prompt That Checks Whether a Pull Request’s Description Actually Matches What the Diff Changes

- 27.09.26 - ErcanOPAK comment on The AI Prompt That Checks Whether a Pull Request’s Description Actually Matches What the Diff Changes

πŸ€– The AI Prompt That Checks the PR Description Against What the Code Actually Does A pull request description is written by a human, usually before or during the work, describing what the change is INTENDED to do – and it’s genuinely common for the code to drift from that description as the work evolves: […]

Read More
Wordpress

WordPress: Recover a Site After a Bad Redirect Rule Sends Every Visitor to the Homepage

- 27.09.26 - ErcanOPAK comment on WordPress: Recover a Site After a Bad Redirect Rule Sends Every Visitor to the Homepage

πŸ“ The Redirect Rule That Was Supposed to Fix One URL and Fixed None of Them A redirect plugin rule (or a manually added .htaccess rewrite) written with an overly broad match pattern – a wildcard intended to catch one specific set of old URLs, written just slightly too loosely – can end up matching […]

Read More
AI

The AI Prompt That Turns a Recipe’s Ingredient List Into a Grocery List Sorted by Aisle

- 27.09.26 - ErcanOPAK comment on The AI Prompt That Turns a Recipe’s Ingredient List Into a Grocery List Sorted by Aisle

πŸ€– The AI Prompt That Turns a Stack of Recipes Into One Sane Grocery List Planning several recipes for the week and shopping for all of them at once usually means manually combining overlapping ingredient lists (three recipes each calling for onions, in slightly different quantities) and then wandering the store re-checking the list aisle […]

Read More
CSS

CSS: Fix a Line-Clamp Truncation That Cuts Off Mid-Word Instead of Adding an Ellipsis

- 27.09.26 - ErcanOPAK comment on CSS: Fix a Line-Clamp Truncation That Cuts Off Mid-Word Instead of Adding an Ellipsis

🎨 The Line Clamp That Cut a Word Cleanly in Half -webkit-line-clamp (the common way to truncate text to a fixed number of lines with a trailing ellipsis) depends entirely on display: -webkit-box and the matching box-orient property being set alongside it – it’s not a standalone property that works on its own. Leaving out […]

Read More
AI

The AI Prompt That Finds Feature Flags Nobody Remembers to Remove

- 27.09.26 - ErcanOPAK comment on The AI Prompt That Finds Feature Flags Nobody Remembers to Remove

πŸ€– The AI Prompt That Finds the Feature Flags Everyone Forgot Were Still There Feature flags are meant to be temporary – a way to ship code behind a toggle, roll it out gradually, and eventually remove the flag once the feature is fully live everywhere. In practice, removing the flag is the step that […]

Read More
SQL

SQL Server: Why Two Sessions Can See Different Data Inside What Looks Like the Same Transaction

- 27.09.26 - ErcanOPAK comment on SQL Server: Why Two Sessions Can See Different Data Inside What Looks Like the Same Transaction

πŸ—„οΈ The Two Sessions That Disagreed About What the Database Actually Said Two connections querying the exact same table at nearly the same moment can legitimately see different data – not due to a bug in either query, but because the database’s isolation level governs exactly what a transaction is allowed to see of another […]

Read More
C#

C#: Fix a Deadlock Caused by Mixing lock and await in the Same Method

- 27.09.26 - ErcanOPAK comment on C#: Fix a Deadlock Caused by Mixing lock and await in the Same Method

πŸ”§ The Fix for a Compiler Error That Turned Into a Deadlock The compiler flatly refuses to let you await inside a lock block (that’s error CS1996, not a warning), which pushes developers toward the obvious substitute: SemaphoreSlim, since it has an async WaitAsync method. The substitution looks equivalent, but a plain lock is reentrant […]

Read More
Ajax

Ajax: Fix a Cross-Tab Race Where One Browser Tab Silently Overwrites Another’s Save

- 27.09.26 - ErcanOPAK comment on Ajax: Fix a Cross-Tab Race Where One Browser Tab Silently Overwrites Another’s Save

πŸ”„ The Save That Quietly Erased a Colleague’s Save From a Minute Earlier Opening the same record in two browser tabs (or two people editing the same record in two separate sessions) and saving from each one independently is an extremely common real-world scenario that a plain last-write-wins AJAX save doesn’t defend against at all […]

Read More
Kubernetes

Kubernetes: Fix a Liveness Probe That Kills Healthy Pods Under Normal Load

- 27.09.26 - ErcanOPAK comment on Kubernetes: Fix a Liveness Probe That Kills Healthy Pods Under Normal Load

☸️ The Liveness Probe That Punished the Pod for Working Hard A liveness probe configured with a tight timeout and a low failure threshold assumes a healthy application always responds quickly – but a genuinely healthy app under real load can legitimately take longer to answer a health check request during a garbage collection pause, […]

Read More
Asp.Net Core

ASP.NET Core: Fix Output Caching That Serves the Same Response to Every User Regardless of Query String

- 27.09.26 - ErcanOPAK comment on ASP.NET Core: Fix Output Caching That Serves the Same Response to Every User Regardless of Query String

βš™οΈ The Cache That Couldn’t Tell One Query String From Another ASP.NET Core’s built-in Output Caching middleware caches a response keyed on the request path by default – it does NOT automatically vary the cached entry by query string parameters unless a policy explicitly says to. That means an endpoint like /products?category=shoes and /products?category=hats can […]

Read More
Wordpress

WordPress: Fix a REST API Endpoint That Keeps Returning Cached Data After You Update a Post

- 27.09.26 - ErcanOPAK comment on WordPress: Fix a REST API Endpoint That Keeps Returning Cached Data After You Update a Post

πŸ“ The REST Endpoint That Never Heard About the Update A caching plugin or a reverse proxy in front of WordPress typically hooks into post-save actions to purge the cached HTML of the pages that display a post – but the WordPress REST API serves its own, separate set of URLs (/wp-json/wp/v2/posts/123 and similar), which […]

Read More
Page 1 of 10
1 2 3 4 5 6 … 10 Next Β»

Posts pagination

1 2 3 … 10 Next »
September 2026
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  
« Aug   Oct »

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 (953)
  • How to add default value for Entity Framework migrations for DateTime and Bool (940)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)
  • 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 (554)
  • 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 (953)
  • How to add default value for Entity Framework migrations for DateTime and Bool (940)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)

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