[c#] Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll)

I'm trying to run this tool in order to convert a Visual C++ project to makefile. The project I'm trying to convert project is written in VS2008, so I'm using a reference to Microsoft.VisualStudio.VCProjectEngine.dll from version 9.

It fails in this line:

VCProjectEngine vcprojEngine = new VCProjectEngineObject();

With the following exception:

Retrieving the COM class factory for component with CLSID {D19A00C4-A7F9-4E14-A5E1-D060B7EB57F3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

When tried to register VCProjectEngine.dll with regsvr32, I got an error that the entry point DllRegisterServer was not found.

Any idea??

Thanks in advance.

This question is related to c# exception com dllregistration

The answer is


There are not many good reasons this would fail, especially the regsvr32 step. Run dumpbin /exports on that dll. If you don't see DllRegisterServer then you've got a corrupt install. It should have more side-effects, you wouldn't be able to build C/C++ projects anymore.

One standard failure mode is running this on a 64-bit operating system. This is 32-bit unmanaged code, you would indeed get the 'class not registered' exception. Project + Properties, Build tab, change Platform Target to x86.


Examples related to c#

How can I convert this one line of ActionScript to C#? Microsoft Advertising SDK doesn't deliverer ads How to use a global array in C#? How to correctly write async method? C# - insert values from file into two arrays Uploading into folder in FTP? Are these methods thread safe? dotnet ef not found in .NET Core 3 HTTP Error 500.30 - ANCM In-Process Start Failure Best way to "push" into C# array

Examples related to exception

Connection Java-MySql : Public Key Retrieval is not allowed How to print an exception in Python 3? ASP.NET Core Web API exception handling Catching FULL exception message How to get exception message in Python properly What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean? what does Error "Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" mean? Argument Exception "Item with Same Key has already been added" The given key was not present in the dictionary. Which key? sql try/catch rollback/commit - preventing erroneous commit after rollback

Examples related to com

Class not registered Error The #include<iostream> exists, but I get an error: identifier "cout" is undefined. Why? How can I generate UUID in C# How to repair COMException error 80040154? BSTR to std::string (std::wstring) and vice versa Microsoft.Office.Core Reference Missing System.Runtime.InteropServices.COMException (0x800A03EC) Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll) How to handle AccessViolationException Register 32 bit COM DLL to 64 bit Windows 7

Examples related to dllregistration

How to repair COMException error 80040154? How do I register a DLL file on Windows 7 64-bit? Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll) How do I register a .NET DLL file in the GAC? ActiveX component can't create object