We help IT Professionals succeed at work.

I'm having problems accessing a COM+ object from ASP.NET in IIS Website mode

I get this error:

Unable to cast COM object of type 'ProntoUtility25.PUtility25Class' to interface type 'ProntoUtility25._PUtility25'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{88589C5C-709D-4823-AE5E-67BA25C5639E}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

I've attached a screenshot of my relevant code.  I get the error when I make the call on line 12 (see screenshot) and when I open the Web Site through the File System way and run it on Cassini it works fine but when I open the Web Site through the Local IIS way and run it through IIS it gives me that error (above).  Obviously, I eventually have to run it on IIS so I'm concerned about getting it to work through that method right away.

And by the way, viewing all the other files on the site through IIS work just fine - as long as they are not calling the COM+ stuff through ASP.NET.  I have classic asp on there that call the COM+ just fine and work as they should and other ASP.NET files on there that work just fine as long as they are not calling the COM+.  


Watch Question


Oh and the COM+ DLLs are registered on the same machine through component services and I added by a Reference in the Bin folder for the asp.net Web Site.

COM Component Compatibility

Try changing your page directive:

<%@Page AspCompat="true" .... etc


RE: PaulHews: The AspCompat="true" by itself didn't solve the problem.

RE: pkumarra: Are you referring to the Interop version of the DLL or the Component Services registered version?

I added readonly access to the registered DDLs for IIS_WPG and that fixed the problem.  Not sure how many other security problems that I might get from that now but at least it's a start.  (thanks PZ)