Silent failure on COM interop dependencies

Hi,
First of all I have a COM interop assembly that is being registered via regasm /codebase. The codebase directory also has several .NET dependencies that are not GAC'd (a base class, shdocvw.dll, etc.) and all of this works fine and the object works as intended. If however, I add a class instance of another type in another assembly in the solution and re-register, the object will not work. oleview also fails to show it and says either:

"CoGetClassObject failed. The system cannot find the file specified. severity: SEVERITY_ERROR, facility: FACILITY_WIN32 ($800070002)"

or

"IClassFactory::Create failed..." can't remember the rest of the message and can't get it to come back.

Both times, regasm says it adds the type ok. In the second case, the new class instance type resides in another assembly right next to the others that were being used while it worked. They're all strong named as well but none of them are GAC'd.

[971 byte] By [andrewpa] at [2008-1-10]
# 1

Hi andrewpa,

I wrote an assembly like your case, it refer to another assembly in the same folder. And I do a test like you’ve described, but I found no problem.

However, I’m not very sure about what exactly do you mean by “I add a class instance of another type in another assembly in the solution and re-register,”, if this “another assembly” does nothing to do with the interop assembly, then the interop assembly will not be changed, and it’s no need to re-register. So could you please cover the solution in more details?

And how exactly did you re-register it?

Thanks!

FengChen-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 2

I've figured this out (with the help of a MS support call). We attached to OleView.exe, which I was using for testing but had not thought of attaching to (I had only tried attaching to Explorer.exe itself). OleView.exe unlike Explorer.exe was able to expose the initialization code and such. Through this view I was able to see that it was simply path information for the manual configuration being incomplete (wrong). Manual configuration is needed here as the .NET assembly is being hosted via COM in Explorer.exe so current directory/process image name etc. would not allow the normal configuration setup to work.

andrewpa at 2007-10-3 > top of Msdn Tech,.NET Development,Common Language Runtime...

.NET Development

Site Classified