0

A few weeks ago, I ran this without any errors (just the normal warning):

tlbimp TypeLibrary.tlb /primary /out:My.Made.Up.Name.dll

Since then, I've run Windows Update (to get several months of updates).

But now, when I run the same command:

tlbimp TypeLibrary.tlb /primary /out:My.Made.Up.Name.dll

I get:

TlbImp : error TI1021 : Primary interop assemblies must be strongly named. This
can be accomplished by using either the /publickey, /keyfile or /keycontainer op
tions.

Is it likely that the behavior of tlbimp has changed as a result of updates, or is there some other reason I can't run tlbimp again?

I definitely didn't have a keyfile last time, so I'm unsure why I might need one this time.

ThunderFrame
  • 9,352
  • 2
  • 29
  • 60
  • 1
    Hmm, no, Windows Update did not move that cheese. A PIA without a strong name is like a boomerang that doesn't come back, it is a stick. Far more likely is that you just didn't use the /primary option before. They were very rarely needed. And especially not today, PIAs have been obsolete for the past 6 years. Thoroughly and elegantly replaced by the "Embed Interop Types" feature. – Hans Passant Feb 11 '16 at 09:13
  • I guess there's a *chance* I omitted the /primary, but I'm pretty sure I didn't. I am embedding types, so I'm not distributing the PIA as part of the solution per se, but I do need to commit the PIA to the Git repo, so other contributors can build the solution. I've already committed one such PIA, and the repo still builds, so I'm guessing that means I *did* use /primary? – ThunderFrame Feb 11 '16 at 10:11

1 Answers1

0

So, I ran ILDASM against the dll and found that there wasn't any Primary Interop flag present, so as per @Hans Passant's comment, the cheese was not moved...

I must have omitted the /primary argument.

ThunderFrame
  • 9,352
  • 2
  • 29
  • 60