Visual Studio 2019 - Debug Interface Access COM component returns 0x80040154 Class not registered error

346 Views Asked by At

My company developed a small tool to read some logs containing a call stack when an error occurs in our apps, and to find which part of our code caused the issue. This tool uses the Visual Studio 2019 Debug Interface Access (DIA2) component to extract the required info from the .pdb file created during the compilation.

However when I run my tool, I get the following error:

DIA2 create instance - FAILED - (0x80040154) - Class not registered - make sure DIA2 Visual Studio component is installed.

I'm pretty sure that the DIA SDK and its relative component is well installed, I can found it in my Visual Studio 2019 installation folder, under the \DIA SDK\bin\ sub-folder. I also checked if the "Desktop development with C++" module was well installed and it's the case, including all its individual components.

I also registered the msdia140.dll in a command prompt opened with administrator rights, with the regsrv32 command. I did that for the 32 and 64 bit dlls, and I retried before and after restarting my computer.

Unfortunately nothing succeeded. I cannot figure out what is the issue. Has someone already faced a such issue? Any idea about how to fix it?

NOTE I'm developing on Windows 11.

1

There are 1 best solutions below

1
Jingmiao Xu-MSFT On

Did you check that \DIA SDK\include\dia2.h and \DIA SDK\lib\diaguids.lib exist in the folder.

The doc said that The DIA SDK is normally installed with Visual Studio and the msdia.dll, which implements the DIA SDK, is automatically registered.

I can't reproduce the problem with the information you provided, but I think it might helpful to repair the vs in visual studio installer.