Reputation: 11232
I have .NET COM dll which I am trying to load from unmanaged C++ code. I am trying to do CoCreateInstance
from my code which fails with the error "System can not find the file specified". (HRESULT value is 0x80070002
). Just to see whether there are any problems with the registration of the component , I tried the same piece of code from my tester. There I am able to create the instance correctly. Also, strangely in the debug mode of my main application CoCreateInstance
succeeds but fails only in release mode. Does anybody has any idea what could be wrong or how can I find the root cause of the problem? I already opened the COM dll in dependency walker and it didn't show any errors. Any help would be greatly appreciated.
Upvotes: 2
Views: 5734
Reputation: 941407
COM doesn't normally generate an ERROR_FILE_NOT_FOUND. But the CLR certainly does, common when trying to find a dependent assembly for example. Be sure to run regasm /codebase from the Release build directory. And use Fuslogvw.exe to trace assembly resolution problems.
Upvotes: 3