Question

I have a COM+ application that has been exported to an MSI using Component Services and then installed on a test server. The web application (ASP) is unable to instantiate any of the objects it uses from the COM+ application.

The COM+ application consists of three DLLs built in VB6. There is one DLL each for data, application and presentation layers. The web application only uses objects from the presentation layer. The COM+ DLLs call into a couple of .NET DLLs exposed via COM.

When the web application runs, an HTTP 500 - Internal Server Error is returned. No errors appear in the application or system log.

I've tried instantiating the objects from VBScript using WSH.CreateObject and it works only for objects in the data layer. When trying to create object in the application or presentation layer I get the following error:

Error: Could not create object named "My.ProgId" 
Code: 800A801D
Source: WScript.CreateObject

Because it fails from VBScript, I suspect that the ASP app is fine and that it is the COM+ application that has issues.

Extra Info

If I uninstall the COM+ application and try to run my VBScript to test instantiation, I get a different error.

Error: Could not locate automation class named "My.ProgId" 
Code: 80020009
Source: WScript.CreateObject

Since the errors are different, it seems that COM is at least finding the COM+ objects when they're installed, it's just not able to instantiate them.

I've also tried monitoring the script with ProcessMon. I can see WScript.exe (via COM) querying the registry for the ProgID, and then the CLSID. Eventually the path to the DLL is pulled back and then svchost.exe and dllhost.exe query the registry for the same information using the CLSID and also getting back the path to the DLL. Eventually the DLL has a Load Image operation against it followed by the same for msvbvm60.dll. I don't see anything that points to a failure accessing the COM+ DLL.

I've now tried installing the COM+ application to another Win2k3 server and a Windows XP desktop. I'm getting the same result with being able to instantiate objects from the data layer DLL, but not from the application and presentation layer DLLs. I've also tried getting an old copy of the application layer DLL and I am able to successfully instantiate objects from it. However, when I compare the project files for the two different versions, nothing stands out as being a possible cause of this problem.

Was it helpful?

Solution

The application layer DLL was referencing a struct defined in a .NET assembly. The error was caused by the type library containing the struct not being registered on the deployment machine.

When building the .NET assembly in Visual Studio, it would create a type library for the assembly and register it. When the app was deployed, the .NET assemblies were registered using regasm /codebase <assemblyname.dll>. That would register the classes so that they could be instantiated, but it did not register any structs.

The solution was to use regtlib.exe to register the type library on the test server.

The error messages were of no help at all when trying to discover the cause of the problem. Come on Microsoft!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top