locked
How to Register Primary Interop Assemblies RRS feed

  • Question

  • Hi all, 

    I'm new with C# and I need to create an application using Primary Interop Assemblies(PIA),  the thing is I've read I need to register The COM component but the example in msdn is not clear at all:

    http://msdn.microsoft.com/en-us/library/shyb58c9(v=vs.110).aspx

    It said I need to type: 
    regasm CompanyA.UtilLib.dll


    But, what is exactly the company? The user of my computer? Which kind of "UtilLib" y need to type?. The PIA component have a lot of .dll files
    Monday, March 3, 2014 12:47 AM

Answers

  • Hello Oscar,

    You are on the wrong avenue.

    There is no need to register interop libraries. The regasm.exe utility is used for registering COM objects. You can read more about PIAs in the Primary Interop Assemblies article in MSDN.


    Monday, March 3, 2014 5:37 AM
  • Hi Oscar,

    The forum thread you are referring to describes the following issue:

    System.Runtime.InteropServices.COMException was unhandled
      Message=Retrieving the COM class factory for component with CLSID {1019A320-508A-11CF-A49D-00AA00574C74} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    It indicates that the COM component was not registered properly. That is why using the regsvr32.exe utility is necessary.

    There is not need to register PIAs.

    Monday, March 3, 2014 3:27 PM
  • The answer is - nothing.

    Please see the need help on Programming MS Project 2007  forum thread for details.

    Monday, March 3, 2014 4:07 PM

All replies

  • Hello Oscar,

    You are on the wrong avenue.

    There is no need to register interop libraries. The regasm.exe utility is used for registering COM objects. You can read more about PIAs in the Primary Interop Assemblies article in MSDN.


    Monday, March 3, 2014 5:37 AM
  • Hi, 

    I've been reading in several places that I need to register  PIA "for most development tasks" 

    http://msdn.microsoft.com/en-us/library/bb398242.aspx

    This guy have exactly the same problem as me, and the responder says It is necessary to register PIA.

    http://social.msdn.microsoft.com/Forums/vstudio/es-ES/23bfd3c5-8b1e-4215-863d-4a674cfc5178/class-not-registered-when-attempting-to-use-microsoftofficeinteropmsprojectprojectclass-c?forum=clr

    Help plz. Thx !
    Monday, March 3, 2014 3:17 PM
  • Hi Oscar,

    The forum thread you are referring to describes the following issue:

    System.Runtime.InteropServices.COMException was unhandled
      Message=Retrieving the COM class factory for component with CLSID {1019A320-508A-11CF-A49D-00AA00574C74} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    It indicates that the COM component was not registered properly. That is why using the regsvr32.exe utility is necessary.

    There is not need to register PIAs.

    Monday, March 3, 2014 3:27 PM
  • Hi, Thanks for your response, 

    I have exactly the same problem in exactly the same place, at the moment of initialize a "Project" object. So, What should I do ?

    The man in the thread says "The COM component you are trying to use is not registered".So,  What kind of COM component should I register ? 

    I wanted to put an screenshot, but my account has not been veryfied yet. This is the error:



    No se pudo recuperar el generador de clases COM para el componente con CLSID {1019A320-508A-11CF-A49D-00AA00574C74} debido al siguiente error: 80040154 Clase no registrada (Excepción de HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    Monday, March 3, 2014 4:03 PM
  • The answer is - nothing.

    Please see the need help on Programming MS Project 2007  forum thread for details.

    Monday, March 3, 2014 4:07 PM