Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

In my web application i am using one dll,which holding many interfaces. I am creating a object for these interfacesto use the functionality.But i got the below error.

System.InvalidCastException: Unable to cast COM object of type 'CSC_PAYROLL.clsPayRollClass' to interface type 'CSC_PAYROLL._clsPayRoll'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3F1035DF-9AC9-4145-A9AE-F9159089D2FA}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
   at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   at CSC_PAYROLL.clsPayRollClass.set_NumPayMonth(Int16 )

what is the issue?
Updated 29-May-13 0:55am
Prasad Khandekar 29-May-13 9:04am    
Have you tried using regsvr32 FULL PATH AND DLL NAME? e.g. regsvr32 D:\MYAPP\DLLS\Payroll.dll

1 solution

The issue is as stated in the error message; the DLL library has not been registered on the system. You need to use regsvr32[^] to register it on your system.
Share this answer
John Sathish Tamilarasu 29-May-13 7:04am    
Yes.I registered and now works fine.Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900