0

Good Day. I have a COM dll which registered using regsvr32 utility. When I tried to add reference to a project, the library is visible in reference list but when I press OK button the error occurs (STG_E_PATHNOTFOUND). Also popup hint on reference in browser shows correct path and dll not moved anywhere from it's registered location. Project and dll have same x64 bitness.

StackTrace

Error   1   The "ResolveComReference" task failed unexpectedly.
System.IO.DirectoryNotFoundException: The path  could not be found. (Exception from HRESULT: 0x80030003 (STG_E_PATHNOTFOUND))

Server stack trace: 
   at System.Runtime.InteropServices.ComTypes.ITypeLib.GetDocumentation(Int32 index, String& strName, String& strDocString, Int32& dwHelpContext, String& strHelpFile)
   at System.Runtime.InteropServices.Marshal.GetTypeLibName(ITypeLib typelib)
   at Microsoft.Build.Tasks.ComReference.GetTypeLibNameForITypeLib(TaskLoggingHelper log, Boolean silent, ITypeLib typeLib, String typeLibId, String& typeLibName)
   at Microsoft.Build.Tasks.ComReferenceInfo.InitializeWithPath(TaskLoggingHelper log, Boolean silent, String path, ITaskItem originalTaskItem, String targetProcessorArchitecture)
   at Microsoft.Build.Tasks.ComReferenceInfo.InitializeWithTypeLibAttrs(TaskLoggingHelper log, Boolean silent, TYPELIBATTR tlbAttr, ITaskItem originalTaskItem, String targetProcessorArchitecture)
   at Microsoft.Build.Tasks.ResolveComReference.ConvertAttrReferencesToComReferenceInfo(List`1 projectRefs, ITaskItem[] typeLibAttrs)
   at Microsoft.Build.Tasks.ResolveComReference.Execute()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Build.Framework.ITask.Execute()
   at Microsoft.Build.CommandLine.OutOfProcTaskAppDomainWrapperBase.InstantiateAndExecuteTask(IBuildEngine oopTaskHostNode, LoadedType taskType, String taskName, String taskLocation, String taskFile, Int32 taskLine, Int32 taskColumn, AppDomainSetup appDomainSetup, IDictionary`2 taskParams)

Error screen

  • It looks like it is failing to find the type library. Have you registered that too? http://stackoverflow.com/questions/4527213/how-to-register-a-legacy-typelib-tlb-on-windows-7 – Ben Feb 09 '16 at 11:38
  • Maybe the type library refers to another type library that cannot be found. Use Tlbimp.exe instead, you'll get a better error message. And OleView.exe to see what the type library looks like. – Hans Passant Feb 09 '16 at 12:32
  • I resolve problem by creating wrapper for this COM library using tlbimp.exe utility and made a reference to this wrapper instead of COM directly. – Дмитрий Смирнов Feb 16 '16 at 12:40

0 Answers0