Trouble With TlbImp and PIAs

3 views
Skip to first unread message

TJoker .NET

unread,
Jul 31, 2003, 10:48:32 AM7/31/03
to
Hi all.
I have a COM dll that I need to use from several .net applications in my
organization.
I'm trying to generate a Primary Interop Assembly (PIA) for it so that all
projects can refer to the same assembly without risks of type mismatches and
so on. My COM dll uses ADODB so I need to use ADODB's PIA from MS to create
my own PIA, right?

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!


TJoker .NET

unread,
Aug 1, 2003, 11:53:11 AM8/1/03
to
Ok, although nobody seemed able to help me with this problem, I managed to
find a workaround for my problem with the help from Christian Fröschlin from
the interop newsgroup.

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...

Reply all
Reply to author
Forward
0 new messages