I have a c# client dll that calls a c# component on a server. When I register
the c# component on the server, everything works great. If the component is
not accessed for a while or I access it the next day, I get a Specified cast
is not valid error. If I reregister the server component, everything works
fine. The type is a runtime type that it cannot cast to at times. The code is
below:
public HIS.CSRData.DataAccess CreateDataAccess()
{
try
{
//declare variable
HIS.CSRData.DataAccess da;
//declare type
Type oServer;
//set variable value
oServer = Type.GetTypeFromProgID("HIS.CSRData.DataAccess",
msComponentServer);
---this is where the error occurs
//set variable and create object
da = (HIS.CSRData.DataAccess)System.Activator.CreateIns tance(oServer);
//return value
return da;
}
catch{}
}
Thanks in advance for any help.
--
Keith