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 16, 2026

C#

C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon

- 16.11.26 - ErcanOPAK comment on C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon

πŸ”§ C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon ConditionalWeakTable<TKey, TValue> ties an entry’s lifetime to its key object being reachable – the moment nothing else in the application holds a strong reference to the key, the garbage collector is free to collect it and the table drops that entry, value included, even if the […]

Read More
Docker

Docker: Fix a Stale COPY Layer After Editing .dockerignore

- 16.11.26 - ErcanOPAK comment on Docker: Fix a Stale COPY Layer After Editing .dockerignore

🐳 Docker: Fix a Stale COPY Layer After Editing .dockerignore Docker’s build cache keys a COPY instruction’s layer off the content hash of exactly what the build context sends it – and that hash is computed only from the files .dockerignore let through the moment the layer was first cached. Editing .dockerignore to newly exclude […]

Read More
Photoshop

Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File

- 16.11.26 - ErcanOPAK comment on Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File

πŸ–ŒοΈ Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File The Pattern Overlay layer style’s Scale percentage is relative to the pattern preset’s own saved resolution, not to the document you’re applying it in. A pattern captured from a low-resolution source – say 72 PPI – and then applied at “Scale: 100%” inside […]

Read More
SQL

SQL Server: Fix a Computed Column Index Skipped by Implicit Cast

- 16.11.26 - ErcanOPAK comment on SQL Server: Fix a Computed Column Index Skipped by Implicit Cast

πŸ—„οΈ SQL Server: Fix a Computed Column Index Skipped by Implicit Cast A computed column index can only be used when a predicate’s expression matches the computed column’s own definition closely enough for the optimizer to recognize it – including matching data types exactly. Comparing the computed column against a parameter of a different type […]

Read More
HTML

HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

- 16.11.26 - ErcanOPAK comment on HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

🧩 HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit The constraint validation API blocks form submission for every required field unless the browser considers that element genuinely not rendered – and the spec’s bar for “not rendered” is narrower than most tabbed-form implementations assume. Hiding an inactive tab with visibility: hidden, or […]

Read More
SQL

SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs

- 16.11.26 - ErcanOPAK comment on SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs

πŸ—„οΈ SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs ROW_NUMBER() requires an ORDER BY, but when that ordering expression has ties – multiple rows sharing the exact same value on every column actually listed – SQL Server is free to break the tie using whatever order the rows happen to arrive from the underlying […]

Read More
C#

C#: Fix an Enum HasFlag Returning True for the Zero Value

- 16.11.26 - ErcanOPAK comment on C#: Fix an Enum HasFlag Returning True for the Zero Value

πŸ”§ C#: Fix an Enum HasFlag Returning True for the Zero Value Enum.HasFlag() checks whether every bit set in its argument is also set on the instance it’s called against – well-defined for a genuine non-zero flag, but when the argument is the enum’s zero value, the check becomes “are all the bits of zero […]

Read More
Wordpress

WordPress: Fix Featured Images Vanishing After a CDN Migration

- 16.11.26 - ErcanOPAK comment on WordPress: Fix Featured Images Vanishing After a CDN Migration

πŸ“ WordPress: Fix Featured Images Vanishing After a CDN Migration WordPress stores an attachment’s URL in post content and in its standard attachment metadata at upload time, pointing at whatever domain was configured then. Migrating media to a CDN by running a URL search-and-replace across the database typically covers wp_posts content and the normal attachment […]

Read More
Photoshop

Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern

- 16.11.26 - ErcanOPAK comment on Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern

πŸ–ŒοΈ Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern Content-Aware Fill decides where to pull replacement texture from based on the Sampling Area setting in the Context Taskbar, which defaults to sampling from the entire image. On a background with an obvious repeating structure – brick, tile, woven fabric – pulling texture from anywhere in […]

Read More
Asp.Net Core

Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

- 16.11.26 - ErcanOPAK comment on Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

βš™οΈ Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy The antiforgery system ties its token to the request’s scheme. Behind a reverse proxy that terminates TLS and forwards plain HTTP to the app, the app sees every request as http unless forwarded-headers middleware is configured to trust and apply the proxy’s X-Forwarded-Proto header. […]

Read More
Git

Git: Fix a Submodule Stuck on a Detached Head After a Pull

- 16.11.26 - ErcanOPAK comment on Git: Fix a Submodule Stuck on a Detached Head After a Pull

πŸ”€ Git: Fix a Submodule Stuck on a Detached Head After a Pull Running git pull on a superproject updates the recorded submodule commit pointer in the index, but unless submodule.recurse is configured, it doesn’t check out that commit inside the submodule’s own working tree – and even when it does, the submodule lands at […]

Read More
CSS

CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width

- 16.11.26 - ErcanOPAK comment on CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width

🎨 CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width Grid items, like flex items, carry an implicit min-width: auto that resolves to the content’s own intrinsic minimum size. For an item containing unbreakable content – a long URL, a wide table, a <pre> block with nothing to wrap on – that intrinsic […]

Read More
Windows

Windows 11: Fix Search Silently Skipping One Indexed Drive

- 16.11.26 - ErcanOPAK comment on Windows 11: Fix Search Silently Skipping One Indexed Drive

πŸͺŸ Windows 11: Fix Search Silently Skipping One Indexed Drive Windows Search tracks each indexed location by a stored volume ID, not just by drive letter. Reassigning a drive letter, swapping a drive while keeping the same letter, or reconnecting a drive after a RAID rebuild can leave the index’s locations list pointing at an […]

Read More
Git

Git: Fix git blame Naming the Wrong Author After Autosquash

- 16.11.26 - ErcanOPAK comment on Git: Fix git blame Naming the Wrong Author After Autosquash

πŸ”€ Git: Fix git blame Naming the Wrong Author After Autosquash An interactive rebase with –autosquash folds fixup! commits into the commit they target, but the merged commit keeps that original commit’s author metadata by default – only the committer date changes. A teammate’s fixup that corrects a real bug in your original line gets […]

Read More
Wordpress

WordPress: Fix Permalinks 404ing After Switching PHP Versions

- 16.11.26 - ErcanOPAK comment on WordPress: Fix Permalinks 404ing After Switching PHP Versions

πŸ“ WordPress: Fix Permalinks 404ing After Switching PHP Versions Pretty permalinks depend on the web server correctly rewriting every request to index.php, and on many managed hosts that rewrite logic is tied to a specific PHP-FPM pool socket baked into the vhost configuration. Switching a site’s PHP version from the hosting control panel can silently […]

Read More
AI

The AI Prompt That Finds Every Caller Broken by a Signature Change

- 16.11.26 - ErcanOPAK comment on The AI Prompt That Finds Every Caller Broken by a Signature Change

πŸ€– The AI Prompt That Finds Every Caller Broken by a Signature Change A compiler flags every direct caller that breaks when you change a method’s signature – but it has nothing to say about a reflection-based call, a dependency-injection container resolving by convention, a config file that references a parameter by name, or a […]

Read More
Visual Studio

Visual Studio: Fix Hot Reload Ignoring an Init-Only Property Edit

- 16.11.26 - ErcanOPAK comment on Visual Studio: Fix Hot Reload Ignoring an Init-Only Property Edit

πŸ› οΈ Visual Studio: Fix Hot Reload Ignoring an Init-Only Property Edit The Hot Reload engine in Visual Studio can patch the body of most methods in a running process without a restart, but it does this by swapping compiled IL for the method you edited while leaving everything else exactly as it was. Editing the […]

Read More
AI

The AI Prompt That Explains Why a Merge Conflict Happened

- 16.11.26 - ErcanOPAK comment on The AI Prompt That Explains Why a Merge Conflict Happened

πŸ€– The AI Prompt That Explains Why a Merge Conflict Happened Git shows you the conflicting lines, never why two branches touched the same code for different reasons. This prompt feeds the model both sides of the conflict along with each branch’s recent commit messages – the same intent signal a human reviewer would use […]

Read More
Asp.Net Core

Asp.Net Core: Fix Minimal APIs Ignoring a Record’s Required Field

- 16.11.26 - ErcanOPAK comment on Asp.Net Core: Fix Minimal APIs Ignoring a Record’s Required Field

βš™οΈ Asp.Net Core: Fix Minimal APIs Ignoring a Record’s Required Field A record’s primary-constructor parameter marked with the C# required modifier is enforced by the compiler at the source-code level, not automatically by System.Text.Json at runtime. Unless the project’s JSON serializer version and configuration correctly wire up required-member validation for records – and the specific […]

Read More
AI

The AI Prompt That Sorts a Messy Photo Library Into Dated Albums

- 16.11.26 - ErcanOPAK comment on The AI Prompt That Sorts a Messy Photo Library Into Dated Albums

πŸ€– The AI Prompt That Sorts a Messy Photo Library Into Dated Albums Years of photos dumped into one camera-roll folder, still under their original camera filenames, is a sorting job most people put off indefinitely. This prompt feeds a model the filenames and their timestamps and asks it to cluster them into sensibly named […]

Read More
Ajax

Ajax: Fix a Cancelled Fetch Still Overwriting Newer Data

- 16.11.26 - ErcanOPAK comment on Ajax: Fix a Cancelled Fetch Still Overwriting Newer Data

πŸ”„ Ajax: Fix a Cancelled Fetch Still Overwriting Newer Data Calling AbortController.abort() on an in-flight fetch() rejects that call’s own promise with an AbortError, but it does nothing about a second, newer fetch that was already started before the first one resolves. If the cancellation logic only aborts the controller without also checking, inside the […]

Read More
Windows

Windows 11: Fix Taskbar Icons Duplicating After a Monitor Reconnect

- 16.11.26 - ErcanOPAK comment on Windows 11: Fix Taskbar Icons Duplicating After a Monitor Reconnect

πŸͺŸ Windows 11: Fix Taskbar Icons Duplicating After a Monitor Reconnect On a multi-monitor setup, explorer.exe rebuilds its per-monitor taskbar state whenever a display is added or removed. Docking and undocking a laptop can make the GPU driver report a monitor as connecting and disconnecting in quick, overlapping succession rather than as one clean event […]

Read More
C#

C#: Fix a Thread-Static Field Resetting on an async Continuation

- 16.11.26 - ErcanOPAK comment on C#: Fix a Thread-Static Field Resetting on an async Continuation

πŸ”§ C#: Fix a Thread-Static Field Resetting on an async Continuation A [ThreadStatic] field’s value is tied to the physical OS thread that set it, not to any logical notion of “the current request.” When an await inside an async method yields and later resumes, the thread pool is free to resume that continuation on […]

Read More
Kubernetes

Kubernetes: Fix an HPA Flapping Between Two Replica Counts

- 16.11.26 - ErcanOPAK comment on Kubernetes: Fix an HPA Flapping Between Two Replica Counts

☸️ Kubernetes: Fix an HPA Flapping Between Two Replica Counts A HorizontalPodAutoscaler recomputes its desired replica count from the average of the target metric across pods on every evaluation cycle – every 15 seconds by default – and scales toward that number immediately unless a stabilization window says otherwise. A workload whose CPU usage naturally […]

Read More
JavaScript

JavaScript: Fix a Debounced Method Losing this on a Class

- 16.11.26 - ErcanOPAK comment on JavaScript: Fix a Debounced Method Losing this on a Class

⚑ JavaScript: Fix a Debounced Method Losing this on a Class A debounce helper wraps a plain function reference and returns a new function that calls the original after a delay. When the wrapped function is a class’s regular method, passed directly into the helper, the debounced wrapper eventually invokes the original as a bare […]

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# (852)
  • 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 (569)
  • 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# (852)

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