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
Visual Studio

Visual Studio: Fix IntelliSense Still Showing a Downgraded NuGet API

- 17.11.26 - ErcanOPAK

🛠️ Visual Studio: Fix IntelliSense Still Showing a Downgraded NuGet API

Downgrading a NuGet package (reverting from v8 back to v6, say, to dodge a breaking change) often leaves IntelliSense still completing members from the newer API long after the restore finishes, because the Roslyn workspace that drives completion caches its view of each referenced assembly’s metadata keyed to the project’s obj folder and the solution’s .vs cache, not to the live contents of the NuGet global-packages folder. If the design-time build that seeded that cache ran before the downgrade actually took effect, Visual Studio keeps suggesting methods and overloads from the package version it last resolved, even though project.assets.json now correctly lists the older one.

🔎 The Problem

Downgrade: ExampleSdk 8.2.0 -> 6.1.0 in the .csproj
dotnet restore completes without errors, project.assets.json now shows 6.1.0

Editor still shows completion for:
  client.SubmitBatchAsync(request, CancellationToken)   <- added in 7.0, removed again in 6.1

Build from the command line: error CS1061
  'ExampleClient' does not contain a definition for 'SubmitBatchAsync'
  (IntelliSense never flagged this before the build)

âś… Fix: Force the Workspace to Re-Resolve the Downgraded Metadata

  • Close the solution, delete every project’s bin and obj folder plus the solution’s .vs directory, then reopen so the Roslyn workspace performs a fresh design-time build against the package version project.assets.json now actually lists.
  • Run NuGet Package Manager > Clear All NuGet Cache(s) before restoring again whenever you’ve just downgraded, since a stale copy in the global-packages or http-cache folder can get picked up even after the project file says otherwise.
  • Treat a downgrade as a reason to do a full command-line dotnet build immediately, rather than trusting a clean-looking Error List, since IntelliSense’s cached metadata and the compiler’s actual resolved references can disagree for an uncomfortably long time after the version number changes.

🚨 Why This Is Dangerous

  • Shipping code that compiles cleanly in the editor because IntelliSense is still quietly offering a method signature from the version you just downgraded away from, only to have the real compiler — or worse, a teammate’s from-scratch clone — reject it with a missing-member error that never showed up locally.

A stale cache doesn’t know you changed your mind about a dependency — only a from-scratch restore does.

— Developer Tip

Related posts:

Visual Studio: Debug Like a Pro with Conditional Breakpoints

Visual Studio: Debug Like a Pro with Conditional Breakpoints

Visual Studio: Use IntelliCode for AI-Powered Code Completion

Visual Studio: Use IntelliCode for AI-Powered Code Completion

Why “Edit and Continue” Lies to You

Why “Edit and Continue” Lies to You

Views: 5

Post navigation

HTML5: Fix a details Element Losing Its Open State After a Form Reset
The AI Prompt That Rewrites a Flaky Test Into a Deterministic One

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

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,059)
  • Get the User Name and Domain Name from an Email Address in SQL (983)
  • How to add default value for Entity Framework migrations for DateTime and Bool (981)
  • Get the First and Last Word from a String or Sentence in SQL (861)
  • How to select distinct rows in a datatable in C# (856)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (658)
  • Add Constraint to SQL Table to ensure email contains @ (613)
  • Average of all values in a column that are not zero in SQL (571)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (549)
  • Find numbers with more than two decimal places in SQL (477)

Recent Posts

  • Visual Studio: Fix Quick Actions Hiding Behind a Stale Squiggle
  • Photoshop: Fix a Smart Filter Resetting After You Relink It
  • Ajax: Fix a Cancelled Request Still Updating Stale UI State
  • C#: Fix a Span Captured by a Lambda Throwing at Runtime
  • The AI Prompt That Converts a REST Endpoint Into a Typed SDK
  • Git: Fix a Worktree Locking a Branch Needed Somewhere Else
  • Asp.Net Core: Fix a Background Service Leaking Scoped Dependencies
  • SQL Server: Fix a Columnstore Index Fragmenting After Bulk Deletes
  • Docker: Fix a Container Losing Logs After a Restart Policy
  • Asp.Net Core: Fix Output Caching Serving a Stale Authorized Page

Most Viewed Posts

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

Recent Posts

  • Visual Studio: Fix Quick Actions Hiding Behind a Stale Squiggle
  • Photoshop: Fix a Smart Filter Resetting After You Relink It
  • Ajax: Fix a Cancelled Request Still Updating Stale UI State
  • C#: Fix a Span Captured by a Lambda Throwing at Runtime
  • The AI Prompt That Converts a REST Endpoint Into a Typed SDK

Social

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