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:
The exception from the event viewer
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)