none
The type initializer for '[Modulename]' threw an exception RRS feed

  • Question

  • I have a VB .NET program written in Visual Studio 2010.  It was developed and compiled on a Windows 7 PC.  It is compiled for Any CPU.  This program loads and runs on any Windows 8 PC but when we try to run it on a Windows 7 PC we get the following error:

    Error 5 - The type initializer for 'Accubend.basBend' threw an exception. From Introfrm.Load.  Accubend is the name of the program.  I have no idea what basBend is.  Introfrm is the first form that gets loaded.  I do not get an error in the event logs for this error.

    The program runs fine on my development box so there is not way of trapping the error and seeing where it is coming from.

    What is basBend and where can I find it so I can see where the error is occurring?

    I have already spent many hours trying to figure this out.

    Please send a response to jmbooher.home@sbcglobal.net.

    Thank you

     



    • Edited by JMikeBoo Thursday, July 16, 2015 3:43 PM
    • Moved by Sheng Jiang 蒋晟 Sunday, July 26, 2015 2:51 AM Not winforms related
    Thursday, July 16, 2015 3:37 PM

Answers

  • Hi JMikeBoo,

    From the error message, -->System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {B544D2BD-354C-456E-9E88-20F71625E7DF}
     failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    Your COM(dll) is not registered in your machine.

    I suggest you could use regasm to register your Com class. you could refer to this MSDN article: https://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.110).aspx

    Regards,
    Youjun Tang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by JMikeBoo Saturday, July 25, 2015 3:43 PM
    Friday, July 24, 2015 7:25 AM

All replies

  • Hi,

    Check the InnerException property of the TypeInitiallizationExcetption; it is likely to contain information about the underlying problem, and exactly where it occurred.

    Then if the issue is still existing, you could share the InnerExcetpion information with us.

    Friday, July 17, 2015 10:01 AM
  • Thanks, since this error does not occur on my development pc where do I find the InnerException on the client pc?
    Monday, July 20, 2015 3:13 PM
  • Below is the error that we receive.

    System.TypeInitializationException: The type initializer for 'AccuBend.basBend' threw an exception. ---> 
    System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {B544D2BD-354C-456E-9E88-20F71625E7DF}
     failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, 
    RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Activator.CreateInstance(Type type)
       at AccuBend.basBend..cctor()

    Monday, July 20, 2015 3:49 PM
  • Hi JMikeBoo,

    From the error message, -->System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {B544D2BD-354C-456E-9E88-20F71625E7DF}
     failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    Your COM(dll) is not registered in your machine.

    I suggest you could use regasm to register your Com class. you could refer to this MSDN article: https://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.110).aspx

    Regards,
    Youjun Tang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by JMikeBoo Saturday, July 25, 2015 3:43 PM
    Friday, July 24, 2015 7:25 AM
  • Thank you very much I was able to track the error down and fix it.
    Saturday, July 25, 2015 3:43 PM