How to programmatically register (set correct path to) a type library from within .NET?
See the question and my original answer on StackOverflowYou should call RegisterTypeLib with the result of ConvertAssemblyToTypeLib
, something like this:
RegisterTypeLib(tlc_DLL.ConvertAssemblyToTypeLib(asm_DLL, s_Path, TypeLibExporterFlags.None, Nothing), s_Path, Nothing)
<DllImport("oleaut32.dll")> _
Private Shared Function RegisterTypeLib(<MarshalAs(UnmanagedType.Interface)> ByVal ptlib As Object, <MarshalAs(UnmanagedType.LPWStr)> ByVal szFullPath As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal szHelpDir As String) As Integer
End Function