I'm using the command line below:
tlbImp.exe "C:\myFolder\MyCOMLib.dll" /out:"C:\myPIAs\Interop.MyCOMLib.dll"
/namespace:MyCOMLib /strictref
/reference:"C:\Program Files\Microsoft.NET\Primary Interop
Assemblies\adodb.dll"
/keyfile:"C:\myOtherFolder\myKey.snk"
/asmversion:1.0.0.0 /silent /primary
I get the error:
TlbImp error: System.ApplicationException - Referenced type library 'ADODB'
does not have a primary
interop assembly registered.
I've tried some variations:
- without /strictref
- without /reference
But I keep getting the same message. I also executed RegAsm on the OLEDB
PIA, but even after that the message is still there...
Has anyone done it before? What am I missing ?
Thanks
TJ!
The problem was that MyCOMLib.dll was compiled against ADO 2.5 and the PIA
released by MS is registered only for ADO 2.7. I don't have access to the
COM component to recompile it for ADO 2.7, so I had to get a PIA for ADO
2.5.
I created "my own" PIA for the ADO 2.5 TypeLib:
tlbImp.exe "C:\Program Files\Common Files\System\ado\msado25.TLB"
/out:"C:\myPIAs\MyAdo25.dll"
/namespace:ADODB /strictref
/keyfile:"C:\myOtherFolder\myKey.snk"
/asmversion:1.0.0.0 /silent /primary
Registered it with RegAsm.exe
Then I was able to create the PIA for MyCOMLib.dll
tlbImp.exe "C:\myFolder\MyCOMLib.dll" /out:"C:\myPIAs\Interop.MyCOMLib.dll"
/namespace:MyCOMLib /strictref
/reference:"C:\myPIAs\MyAdo25.dll"
/keyfile:"C:\myOtherFolder\myKey.snk"
/asmversion:1.0.0.0 /silent /primary
I hope this helps somebody else in the future.
TJ!
"TJoker .NET" <nos...@nonono.no> wrote in message
news:OPcJRL3V...@TK2MSFTNGP09.phx.gbl...