none
COM interop causes APPCRASH when run from .NET executable on Windows 7 x86 RRS feed

  • Question

  •  

    This is the situation.

    I have a class library that essentially contains a full application.

    Due to requiring the use of some COM-based (VB6) legacy components, it uses COM interop.

    There are currently two ways to launch the application - one is a tiny .NET executable which load a COM component for handling authentication using:

    dynamic
     uca = Activator
    .CreateInstance(Type
    .GetTypeFromProgID("..."
    ));

    ... and the other a VB6 executable that does the exact same thing using CreateObject().

     

    Both of these work fine on my workstation running Windows 7 x64, however on a VMWare machine I use for testing, which runs Windows 7 x86, only the VB6 executable works. The .NET executable just crashes, stating that:

     

    Problem signature:
     Problem Event Name:	APPCRASH
     Application Name: AppLauncher.exe
     Application Version:	1.0.0.0
     Application Timestamp:	4cd3b878
     Fault Module Name:	MSVBVM60.DLL
     Fault Module Version:	6.0.98.15
     Fault Module Timestamp:	4a5bda6c
     Exception Code:	c0000005
     Exception Offset:	00045e8a
     OS Version:	6.1.7600.2.0.0.256.1
     Locale ID:	1044
     Additional Information 1:	0a9e
     Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
     Additional Information 3:	0a9e
     Additional Information 4:	0a9e372d3b4ad19135b953a78882e789
    
    Read our privacy statement online:
     http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    
    If the online privacy statement is not available, please read our privacy statement offline:
     C:\Windows\system32\en-US\erofflps.txt


    After doing a little debugging on this, I've pinpointed the crash to just after dynamically loading the COM login component, and when attempting to call it's login method.

    After installing VB6 on the test machine, and trying to debug the offending component, I find that interestingly when using the .NET executable, the execution never even gets into the method that seems to cause the crash at all, nor does it even get into the class' Initialize() method. I also tested that it DOES enter both of these when launching from the VB6 executable.

    I've tried to clean out the .NET frameworks using the .NET cleanup tool and reinstalling the full .NET 4.0 framework, but it made no difference.

    Has anyone got any idea what could be causing this weird crash, and why it would behave differently depending on whether it is run through a .NET executable or a VB6 executable?

    Friday, November 5, 2010 11:47 AM

Answers