none
Execution error in Windows 7 and Windows 8: Unhandled exception - Class not registered

    Question

  • After installing my Windows Forms Application on Windows 7 (Ultimate) and Windows 8 (beta) virtual and real machines, I get the following execution error as the application tries to load:

    • Bootstrap Error: An unhandled exception (Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))) occurred while bootstrapping the application.

    I am privately deploying SQL Server Compact 3.5 SP1 using Erik's recommended x86 and AMD64 folders and wonder if this error may be related to how SQL Server Compact is being deployed.  It does not seems to occur on Windows XP installations.  My app.config includes the following system.data section:

    <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SqlServerCe.3.5" />
          <add name="Microsoft SQL Server Compact Data Provider 3.5"
            invariant="System.Data.SqlServerCe.3.5"
            description=".NET Framework Data Provider for Microsoft SQL Server Compact"
            type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"       />
        </DbProviderFactories>
      </system.data>

    Thanks for any help!


    -BGood

    • Moved by Maggie Luo Friday, August 31, 2012 3:10 AM (From:SQL Server Compact)
    • Moved by Sheng Jiang 蒋晟MVP Thursday, July 10, 2014 10:32 PM native interop
    Monday, August 27, 2012 5:14 PM

Answers

  • Thanks Maggie. 

    I originally thought it might be related to private deployment of SQL Server Compact, and that is why I posted in that forum.

    It turns out that the problem was actually installer-based.  The unregistered COM component exception is related to the VB control (AxInterop.AcroPDFLib.dll and Interop.AcroPDFLib.dll) I use for synchronizing PDF documents with database records and the OCX/COM wrapper requires that Adobe Reader be installed.  I fixed the problem by specifying Adobe Reader as a prerequisite.


    -BGood


    • Edited by BGood Friday, August 31, 2012 3:38 AM
    • Marked as answer by Bob Wu-MT Friday, September 07, 2012 10:11 AM
    Friday, August 31, 2012 3:37 AM

All replies

  • I am not sure it is related, handle errors and error logging better to get a full call stack.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog

    Monday, August 27, 2012 6:01 PM
  • Any suggestion as to how I get a more verbose error report in this situation?  My application apparently does not finish loading when the exception is thrown.  Thanks.

    -BGood

    Monday, August 27, 2012 6:38 PM
  • Hi BGood,

    Since your issue is related to Windows Forms, I have moved your thread to a more appropriate forum. You would receive better and quicker support.

    Thanks,
    Maggie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

    Friday, August 31, 2012 3:30 AM
  • Thanks Maggie. 

    I originally thought it might be related to private deployment of SQL Server Compact, and that is why I posted in that forum.

    It turns out that the problem was actually installer-based.  The unregistered COM component exception is related to the VB control (AxInterop.AcroPDFLib.dll and Interop.AcroPDFLib.dll) I use for synchronizing PDF documents with database records and the OCX/COM wrapper requires that Adobe Reader be installed.  I fixed the problem by specifying Adobe Reader as a prerequisite.


    -BGood


    • Edited by BGood Friday, August 31, 2012 3:38 AM
    • Marked as answer by Bob Wu-MT Friday, September 07, 2012 10:11 AM
    Friday, August 31, 2012 3:37 AM