Does anyone use old versions of Visual Studio?

I've been using Visual Studio since VS2019. The intervening releases (VS2022 and VS2026) don't feel much different to me, they all have the same problems:

  • Editing too many files (a few dozen) causes either devenv.exe or vcpkgsrv.exe to consume abnormally high CPU. I must close all files (and lose undo history) to get them back to normal
  • Constantly trying to ping the internet. For example BackgroundDownload.exe randomly consumes 20% CPU despite being blocked by the firewall, deleted from task scheduler, and disabled in the registry. VS2026 even has a "retirement" date, a popup informed me today that I'll no longer be able to use it past that date without updating.

I've heard good words about old versions of VS, but I don't know if they are still usable today. The most important to me is using them with the newest compiler and toolset. Existing solutions also need to be made compatible with old formats. Does anyone still use old VS, what's the experience like? Are there features you miss?

reddit.com
u/mbolp — 1 day ago

Question about coroutines

I have a function that takes a callback, like this:

void LongTask (void (*pfn)(int))
{
    for ( unsigned i = 0; i < -1; ++i )
    {
        pfn( i );
    }
}

It's orginally written to be ran on a separate thread. Now I want to turn it into a coroutine that yields on each callback (i.e. the caller will receive a single callback on each invocation of LongTask), while preserving its ability to run as a standalone function. Additionally it's OK for the coroutine to allocate memory but not to throw exceptions (if it can't allocate I should get back a null pointer at creation time). And preferrably it wouldn't require the CRT, all support functions should be contained in a header only include. What's the best way to do this, can it be done with C++20 coroutines?

reddit.com
u/mbolp — 4 days ago

How to include one cpp file in another in Visual Studio?

If I edit a header file in Visual Studio, all cpp files that include it are automatically recompiled. But if I edit a cpp file included in another cpp file, that other file is not recompiled. How can I specify that one cpp file depends on another?

reddit.com
u/mbolp — 19 days ago

Unresolved external symbol operator delete?

I'm trying to build a program without the CRT using /NODEFAULTLIB. The linker says one particular object file has

>error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)

But I don't call new or delete in this file (or anywhere else). It has a few references to placement new and explicit destructor calls (e.g. new( &amp;Object ) CObject; Object.~CObject( )), but I use those in other files and they don't have link errors. I looked at the assembly listing with /FAs and found no occurrence of either calls to operator delete or the string "??3@YAXPEAX_K@Z" (though I did find the latter in the object file). The only standard C++ headers I include are <type_traits> and <algorithm>, but I don't call anything from them in this file and they don't cause problems in other files. What could be referencing operator delete with a size argument?

reddit.com
u/mbolp — 1 month ago

Debugging Windows virtual machines causes absurdly high CPU usage

My host computer is Windows 11 23H2. I've tried debugging Windows Sandbox and a Hyper-V Windows 11 virtual machine via a COM port using kd.exe. Whenever I break into the debugger, a process named vmmem (or vmmemSandbox in the case of Windows Sandbox) starts consuming nearly 100% CPU, making the debugger basically unusable. If I suspend the process most debugger commands hang. Also while kd is waiting for a connection I can't exit. Ctrl-C, Ctrl-Break, q, none of them work (the command is kd -k com:pipe,port=\\.\pipe\TestPipe,resets=0,reconnect). What am I doing wrong?

reddit.com
u/mbolp — 2 months ago

Visual Studio 2026 doesn't highlight selected items properly

Both VS2019 and VS2022 highlight items (including the current line in the code editor plus selected items in tool windows such as solution explorer or find results) by coloring the entire line:

https://preview.redd.it/vxm6tgx72t6h1.png?width=1920&format=png&auto=webp&s=47a44f4969d829e7eab53fc1c0085e5b472de224

I upgraded to VS2026, now items are highlighted with a tiny bar to the left:

https://preview.redd.it/yxr40qi92t6h1.png?width=1920&format=png&auto=webp&s=382faaa0c73b9105ad4ff9687a0e558dd3500cca

This is very difficult to see. Both screenshots use identical settings and themes (high contrast). How to revert this behavior?

Also semi related, the window frame is colored differently in VS2026. This doesn't impact usability but I'd prefer the old colors if possible (I imported all settings from VS2022 with no changes).

reddit.com
u/mbolp — 2 months ago

Fold expression compiles to nothing after upgrading Visual Studio

My code looks like this:

template&lt;class... Ts&gt;
struct COuter
{
    struct CObject : Ts... { };
    struct CInner { int Field; CObject Object; };
    
    static void
    CallEachMethod(void* pv)
    {
        int Output;
        CObject* pObj = &amp;( (CInner*)pv )-&gt;Object;
        
        ( ..., ( (Ts*)pObj )-&gt;Ts::Method( &amp;Output, 0, 0 ) );
    }
};

The idea is to call the same method of all base classes in turn, something like COuter&lt;A, B, C&gt;::CallEachMethod( pv ). This worked as expected in Visual Studio 2022. I upgraded to Visual Studio 2026 and changed Platform Toolset to v145 (from v143), and I get the following output in debug mode.

mov  qword ptr [rsp+8],rcx  
push rbp  
push rdi  
sub  rsp,158h  
lea  rbp,[rsp+20h]  
lea  rdi,[rsp+20h]  
mov  ecx,1Eh  
mov  eax,0CCCCCCCCh  
rep  stos dword ptr [rdi]  
mov  rcx,qword ptr [rsp+178h]  
lea  rcx,[TheFileName@h]
call __CheckForDebuggerJustMyCode
nop  
mov  rax,qword ptr [pv]  
add  rax,4h  
mov  qword ptr [pObj],rax  
lea  rcx,[rbp-20h]  
lea  rdx,[string L"Some global string"+240h]
call _RTC_CheckStackVars
lea  rsp,[rbp+138h]  
pop  rdi  
pop  rbp  
ret  

The method calls are GONE. It even sets up stack overwrite checking (the method takes an output parameter), but never bothers actually making the call.

Edit: Side by side comparison of VS17 and VS18 output: https://godbolt.org/z/b4fMoEz3c.

u/mbolp — 2 months ago