Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET calls VFP COM object but the interop call doesn't create an object

Status
Not open for further replies.

RedLion

Programmer
Sep 13, 2000
342
NL
Hi,

I have an ASP.net webpage running in a 32 bit application pool within IIS which calls a VFP COM object.

From time to time the initiation of the COM object within ASP.net fails and the webpage has to be renewed before it works again.
But the result of this is that after so many exceptions the application pool stops running. And then nobody is able to visit a page again till I manually restart the application pool.

I really have no idea where to look, because 99% of the calls go without any problem, but from time to time the bold line in the code below fails. Anyone an idea?

code where the exception occurs:
Code:
 public class Vfp
    {
        // interface to VFP
        private static myVFPcom.iweb _VfpCom = null;
        private myVFPcom.iweb VfpCom
        {
            get
            {
                if (_VfpCom == null)
                    _VfpCom = new myVFPcom.iweb(); [b]// this is the line where the exception occurs!!!!
[/b]                return _VfpCom;
            }
        }

        private object GetProperty(object loObject, string lcProperty)
        {
            return loObject.GetType().InvokeMember(
                         lcProperty, BindingFlags.GetProperty, null, loObject, null);
        }

        private object CallMethod(object loObject, string lcMethod, params object[] loParams)
        {
            return loObject.GetType().InvokeMember(lcMethod,
                        BindingFlags.InvokeMethod, null, loObject, loParams);
        }

The exception from the event viewer
Code:
An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT/MyVFPApplication

Process ID: 2128

Exception: System.Runtime.InteropServices.COMException

Message: Creating an instance of the COM component with CLSID {6F7083C4-5431-41D8-8B4E-F364424C97B4} from the IClassFactory failed due to the following error: 80040111 ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE)).


Exception information: 
    Exception type: COMException 
    Exception message: Creating an instance of the COM component with CLSID {6F7083C4-5431-41D8-8B4E-F364424C97B4} from the IClassFactory failed due to the following error: 80040111 ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE)).
   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)
 
Have you verified that something isn't failing occasionally in the Init() of the VFP COM DLL that would cause the error to bubble up in your ASP.Net code? Are you doing any error-logging inside the VFP COM DLL? If not, that's where I would begin.
 
0x80040111 (CLASS_E_CLASSNOTAVAILABLE) shouldn't happen occasionally.
If the VFP project is compiledwith the build option "Regenerate Component IDs", the CLSID oftheVFP ComServerwould change and the CLSID {6F7083C4-5431-41D8-8B4E-F364424C97B4} the IClassFactory knows will be outdated. If that's what happens, it shuold happen always after a new DLL version is created and not sparsely.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top