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

Category: Visual Studio

Visual Studio

Visual Studio: Modernizing Your IDE for Extreme Focus

- 01.03.26 - ErcanOPAK comment on Visual Studio: Modernizing Your IDE for Extreme Focus

🚀 Code Like a Rockstar Stop squinting at your braces! Visual Studio 2022’s native Rainbow Braces and Sticky Scroll change the game. Why Your Current Setup Sucks: Deeply nested code is a cognitive drain. When you lose track of which ‘}’ belongs to which ‘if’, you lose flow. Sticky ScrollKeeps the class/method header at the […]

Read More
Visual Studio

Visual Studio: Post-Mortem Debugging with Managed Memory Dumps

- 01.03.26 - ErcanOPAK comment on Visual Studio: Post-Mortem Debugging with Managed Memory Dumps

🔍 The ‘Unreproducible’ Bug Fix Sometimes a bug only happens in Production. Instead of guessing, take a .dmp file and open it in Visual Studio. The Pro Flow: Go to Debug -> Managed Memory. VS will show you exactly which objects were alive, their size on the heap, and the ‘Root’ that prevents them from […]

Read More
Visual Studio

Visual Studio: Visualizing Multithreaded Chaos with Parallel Stacks

- 01.03.26 - ErcanOPAK comment on Visual Studio: Visualizing Multithreaded Chaos with Parallel Stacks

⚡ Senior Debugging Technique When debugging high-concurrency apps, the standard ‘Call Stack’ window is useless because it only shows one thread at a time. Enter Parallel Stacks. This window provides a graphical view of all threads in your system, grouping those that are executing the same code path. It’s the fastest way to identify a […]

Read More
Visual Studio

Visual Studio: Using [DebuggerDisplay] to Speed Up Your Debugging Sessions

- 28.02.26 - ErcanOPAK comment on Visual Studio: Using [DebuggerDisplay] to Speed Up Your Debugging Sessions

Tired of clicking the small arrow to see object properties while debugging? DebuggerDisplay shows the data you want directly in the variable list. [DebuggerDisplay(“User: {Name} (ID: {Id})”)] public class User { public int Id { get; set; } public string Name { get; set; } } The Fix: This attribute forces Visual Studio to show […]

Read More
Visual Studio

Visual Studio: Stop the ‘Out of Memory’ Crashes in Large Solutions

- 28.02.26 - ErcanOPAK comment on Visual Studio: Stop the ‘Out of Memory’ Crashes in Large Solutions

If you are working on a solution with 50+ projects, Visual Studio might feel sluggish. The culprit is often the Diagnostic Tools and IntelliCode cache. Pro Hack: Disable ‘Enable Diagnostic Tools while debugging’ in Tools -> Options -> Debugging -> General. This reduces RAM usage by up to 1.5GB during active sessions. For even better […]

Read More
Visual Studio

Visual Studio: Automating Frontend Assets with Built-in Task Runner Explorer

- 28.02.26 - ErcanOPAK comment on Visual Studio: Automating Frontend Assets with Built-in Task Runner Explorer

The Problem: Manually running Gulp, Grunt, or Npm scripts every time you build or open a project is a productivity killer. Visual Studio’s Task Runner Explorer allows you to bind specific scripts to IDE events like ‘Project Open’ or ‘Before Build’. Why this is a Life Saver: Consistency: Ensures every developer on the team runs […]

Read More
Visual Studio

Visual Studio 2022: The Hidden Power of CodeLens That 10x Developers Actually Use

- 23.02.26 - ErcanOPAK comment on Visual Studio 2022: The Hidden Power of CodeLens That 10x Developers Actually Use

🎯 The Problem Most Developers Face You’re reading code and wondering: “Who wrote this? When was it last changed? Where is it being used?” Opening Git history, searching references – it all takes precious seconds that add up to hours every week. Enter CodeLens: Your Code Intelligence Layer CodeLens displays contextual information directly above methods […]

Read More
Visual Studio

Visual Studio: Use Live Unit Testing to See Test Results While Coding

- 22.02.26 - ErcanOPAK comment on Visual Studio: Use Live Unit Testing to See Test Results While Coding

Running tests manually after every change is slow. Live Unit Testing runs tests automatically as you type and shows results inline. Enable: Test → Live Unit Testing → Start Visual Indicators: Green checkmark = passing tests, Red X = failing tests, Blue dash = not covered by tests. Shows directly in code editor margin! Performance: […]

Read More
Visual Studio

Visual Studio 2022: Revolutionary Webhook Debugging with Dev Tunnels

- 21.02.26 - ErcanOPAK comment on Visual Studio 2022: Revolutionary Webhook Debugging with Dev Tunnels

📌 Executive Summary Developing webhooks or mobile backends usually requires complex tools like Ngrok. Visual Studio’s Dev Tunnels feature changes everything by providing a built-in, secure public URL for your localhost. The Technical Workflow Dev Tunnels create a secure relay between the internet and your local machine. This is critical for testing Stripe webhooks, GitHub […]

Read More
Visual Studio

Visual Studio: The Ultimate ‘Zero-Mouse’ Workflow for Senior Devs

- 21.02.26 - ErcanOPAK comment on Visual Studio: The Ultimate ‘Zero-Mouse’ Workflow for Senior Devs

🚀 Speed Up Your Coding by 300% Mouse movements are the biggest productivity killers. Master these specific chord combinations to stay in the zone. Action Shortcut Quick Refactor Ctrl + . Search Everything Ctrl + T Peek Definition Alt + F12 Pro Tip: Use Ctrl + Shift + V to access your clipboard ring. It […]

Read More
Visual Studio

Visual Studio: Memory Profiling to Kill Hidden Memory Leaks

- 21.02.26 - ErcanOPAK comment on Visual Studio: Memory Profiling to Kill Hidden Memory Leaks

Professional developers don’t just debug; they profile. If your app slows down over time, you likely have a memory leak. The Pro Move: Use the Diagnostic Tools (Alt+F2). Take two snapshots of the heap and use the ‘View Heap’ tool to compare them. Visual Studio will show you exactly which objects are staying in memory […]

Read More
Visual Studio

Visual Studio: Master Conditional Breakpoints to Debug Complex Loops

- 21.02.26 - ErcanOPAK comment on Visual Studio: Master Conditional Breakpoints to Debug Complex Loops

Stopping at every iteration in a loop of 1000 items is a nightmare. Conditional breakpoints let you pause only when a specific state is met. The Fix: Right-click a breakpoint -> ‘Conditions’. Enter a C# expression like user.Id == 542 or items.Count > 10. Why? It saves hours of ‘F5-spamming’ and allows you to catch […]

Read More
Visual Studio

Visual Studio: Use Code Snippets to Insert Common Code Patterns Instantly

- 21.02.26 - ErcanOPAK comment on Visual Studio: Use Code Snippets to Insert Common Code Patterns Instantly

Typing repetitive code structures wastes time. Code snippets insert entire templates with Tab shortcuts. Built-in Snippets: // Type and press Tab twice prop → Creates property with getter/setter ctor → Creates constructor for → Creates for loop foreach → Creates foreach loop try → Creates try-catch block cw → Console.WriteLine() Example Usage: 1. Type “prop” […]

Read More
Visual Studio

Visual Studio: Use Hot Reload to Apply Code Changes Without Restarting App

- 17.02.26 - ErcanOPAK comment on Visual Studio: Use Hot Reload to Apply Code Changes Without Restarting App

Restarting app after every small change wastes minutes. Hot Reload applies changes to running app instantly. Enable Hot Reload: Click the flame icon 🔥 in Debug toolbar (or Alt+F10) Works While: – App is running (with or without debugger) – Even during breakpoints Supports: – Method body changes – Adding new methods – CSS/XAML changes […]

Read More
Visual Studio

Visual Studio: Use Peek Definition to View Code Without Opening Files

- 16.02.26 - ErcanOPAK comment on Visual Studio: Use Peek Definition to View Code Without Opening Files

Constantly opening files to check definitions? Peek Definition shows code inline without switching files. Use Peek: Right-click symbol → Peek Definition (or Alt+F12) Features: – Shows definition in popup window – Edit code directly in peek window – Navigate to related definitions – Multiple peeks can be open simultaneously Keyboard Navigation: – Alt+F12: Peek Definition […]

Read More
Visual Studio

Visual Studio: Use Solution Filters to Load Only Projects You Need

- 15.02.26 - ErcanOPAK comment on Visual Studio: Use Solution Filters to Load Only Projects You Need

Large solution taking 5 minutes to load? Solution filters load only selected projects instantly. Create Filter: 1. Right-click solution → Unload unnecessary projects 2. File → Save As Solution Filter (.slnf) 3. Next time: Open .slnf instead of .sln Result: Solution with 50 projects: 5 min load time Filter with 5 projects: 10 sec load […]

Read More
Visual Studio

Visual Studio: Attach to Process for Debugging Running Applications

- 15.02.26 - ErcanOPAK comment on Visual Studio: Attach to Process for Debugging Running Applications

Need to debug app that’s already running? Attach debugger instead of restarting from VS. Steps: 1. Debug → Attach to Process (Ctrl+Alt+P) 2. Find your process (e.g., MyApp.exe, w3wp.exe for IIS) 3. Click Attach Debugger attaches to running process – breakpoints work immediately! Common Use Cases: – Debug production issues on server – Debug Windows […]

Read More
Visual Studio

Visual Studio: Use Multi-Caret Editing to Change Multiple Lines at Once

- 14.02.26 - ErcanOPAK comment on Visual Studio: Use Multi-Caret Editing to Change Multiple Lines at Once

Editing same text on multiple lines one by one is tedious. Multi-caret lets you edit all simultaneously. Add Carets: Hold Alt + Click where you want additional cursors Or Select Multiple: 1. Select text 2. Press Ctrl+D repeatedly to select next occurrence 3. Type to change all at once Example: // Change all ‘firstName’ to […]

Read More
Visual Studio

Visual Studio: Use Code Cleanup on Save to Auto-Format Code

- 13.02.26 - ErcanOPAK comment on Visual Studio: Use Code Cleanup on Save to Auto-Format Code

Manually fixing formatting issues wastes time. Let Visual Studio auto-format every time you save. Setup: Tools → Options → Text Editor → Code Cleanup → Check “Run Code Cleanup profile on Save” Choose profile: Full Cleanup What It Does: // Before save (messy): public void test(){int x=5;var y=10;Console.WriteLine(x+y);} // After save (clean): public void Test() […]

Read More
Visual Studio

Visual Studio: Pin Variables While Debugging to Track Values Across Sessions

- 13.02.26 - ErcanOPAK comment on Visual Studio: Pin Variables While Debugging to Track Values Across Sessions

Lost track of important variable values when stepping through code? Pin them to keep them visible. How to Pin: // While debugging, hover over any variable var userId = 12345; // Click the pin icon that appears // Variable stays visible even when out of scope Benefits: Pinned variables persist across debug sessions. Close VS, […]

Read More
Visual Studio

Visual Studio Live Share: Real-time Collaborative Coding Like Google Docs

- 05.02.26 - ErcanOPAK comment on Visual Studio Live Share: Real-time Collaborative Coding Like Google Docs

Need to pair program with remote teammates? Live Share turns VS Code into a collaborative editor with shared debugging. # Installation # 1. Install Live Share extension in VS Code # Extensions → Search “Live Share” # Install by Microsoft # 2. Sign in with GitHub/Microsoft account # 3. Start a session # Click Live […]

Read More
Visual Studio

Visual Studio: Stop Debugger from Stepping Into .NET Framework Source Code

- 03.02.26 - ErcanOPAK comment on Visual Studio: Stop Debugger from Stepping Into .NET Framework Source Code

Debugging your code but accidentally stepping into framework methods like String.Format() or Linq internals? This wastes precious debugging time. The Annoying Problem: var users = GetUsers(); var result = users.Where(u => u.IsActive).ToList(); // Press F11 here // Debugger jumps into: // → Enumerable.cs (framework code) // → Buffer.cs // → List.cs // You just wanted […]

Read More
Visual Studio

Speed Up Visual Studio 2022 Build Times by 60% with This Hidden Setting

- 01.02.26 | 01.02.26 - ErcanOPAK comment on Speed Up Visual Studio 2022 Build Times by 60% with This Hidden Setting

If your Visual Studio builds are taking forever, there’s a game-changing setting most developers miss entirely. The Problem: By default, Visual Studio uses only ONE CPU core for parallel project builds, even if you have 8, 16, or more cores available. This bottleneck can turn a 30-second build into a 2-minute nightmare. The Solution: Tools […]

Read More
Visual Studio

Why Your Debug Session Lies About Reality (And How to Fix It)

- 31.01.26 - ErcanOPAK comment on Why Your Debug Session Lies About Reality (And How to Fix It)

Ever noticed code behaving differently in Debug vs Release? Root cause Visual Studio injects: Different JIT optimizations Conditional compilation (#if DEBUG) Altered timing (especially async code) Hidden fix Force Release-mode debugging: <PropertyGroup Condition=”‘$(Configuration)’==’Release'”> <DebugType>portable</DebugType> </PropertyGroup> Why this matters Many race conditions only exist in optimized builds.Debug mode can mask real production bugs.

Read More
Visual Studio

Why Visual Studio IntelliSense Gets Slower as Your Solution Grows

- 30.01.26 - ErcanOPAK comment on Why Visual Studio IntelliSense Gets Slower as Your Solution Grows

Big solution, many projects… suddenly IntelliSense feels drunk. Root cause Visual Studio keeps: Symbol cache per project Roslyn analysis results Design-time builds running in background These accumulate and slow down parsing. Fix (safe & underrated) Disable design-time builds for large solutions Clear ComponentModelCache periodically %LOCALAPPDATA%\Microsoft\VisualStudio\<version>\ComponentModelCache Why it works Forces VS to rebuild symbol graphs cleanly.

Read More
Visual Studio

Stop Visual Studio From Silently Using the Wrong Build Configuration

- 29.01.26 - ErcanOPAK comment on Stop Visual Studio From Silently Using the Wrong Build Configuration

One of the most dangerous Visual Studio behaviors is building and running with a different configuration than you think.You debug Debug, but the app actually runs Release — or worse, a cached build. Why this happens Multiple startup profiles IIS Express vs Kestrel mismatch Configuration Manager not synced across projects Life-saving fix Open Configuration Manager […]

Read More
Visual Studio

Solution Filters for Massive Repos

- 28.01.26 - ErcanOPAK comment on Solution Filters for Massive Repos

TipUse .slnf (Solution Filter) files to load only the projects you actually need. Why it mattersLarge solutions kill startup time. Filters reduce memory usage and speed up context switching without touching the main solution.

Read More
Visual Studio

Use Task List Comments as a Lightweight Issue Tracker

- 27.01.26 - ErcanOPAK comment on Use Task List Comments as a Lightweight Issue Tracker

// TODO: optimize cache eviction // HACK: temporary workaround for legacy API View → Task List Why it mattersYou get an in-IDE micro issue tracker without Jira friction. Perfect for solo or small teams.

Read More
Visual Studio

Use Solution Filters to Load Only What You Need

- 26.01.26 - ErcanOPAK comment on Use Solution Filters to Load Only What You Need

Large solutions kill startup time and focus. Hidden feature: Solution Filters (.slnf) dotnet slnf create dotnet slnf add MyProject.csproj Why it mattersVisual Studio loads only required projects → faster boot, less RAM, more focus.

Read More
Visual Studio

Hidden Feature That Fixes “Works on My Machine” Bugs

- 25.01.26 - ErcanOPAK comment on Hidden Feature That Fixes “Works on My Machine” Bugs

Use Solution Filters (.slnf) for large solutions. Instead of loading the entire solution (slow, error-prone), load only what you need. File → Save As Solution Filter Why this mattersDifferent devs load different projects → fewer mismatched dependencies → fewer “but it works here” issues.

Read More
Page 1 of 3
1 2 3 Next »

Posts navigation

Older posts
March 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Feb    

Most Viewed Posts

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

Recent Posts

  • C#: Saving Memory with yield return (Lazy Streams)
  • C#: Why Records are Better Than Classes for Data DTOs
  • C#: Creating Strings Without Memory Pressure with String.Create
  • SQL: Protecting Sensitive Data with Dynamic Data Masking
  • SQL: Writing Readable Queries with Common Table Expressions (CTE)
  • .NET Core: Handling Errors Gracefully with Middleware
  • .NET Core: Mastering Service Lifetimes (A Visual Guide)
  • Git: Surgical Stashing – Don’t Save Everything!
  • Git: Writing Commits That Your Future Self Won’t Hate
  • Ajax: Improving Perceived Speed with Skeleton Screens

Most Viewed Posts

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

Recent Posts

  • C#: Saving Memory with yield return (Lazy Streams)
  • C#: Why Records are Better Than Classes for Data DTOs
  • C#: Creating Strings Without Memory Pressure with String.Create
  • SQL: Protecting Sensitive Data with Dynamic Data Masking
  • SQL: Writing Readable Queries with Common Table Expressions (CTE)

Social

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