Register type library x64 regtlib

2019-06-24 11:06发布

问题:

I'm running Windows 7 x64, and need to register a type library file (.tlb). I've done this previously (on a Vista x64 machine) but neglected to take notes as to how I achieved it...

There is no regtlib.exe / regtlibv12.exe on the system. I have copied across the regtlibv12.exe from a Windows XP system, however this will "not run".

I have also attempted to register the TLB via "regsvr32" (tried using both the 32 and 64 bit versions) however always get the "Windows system mismatch" error.

I have been performing these operations using an elevated privilege command prompt.

Can anyone help?

回答1:

I used http://www.vbaccelerator.com/home/VB/Utilities/Type_Library_Registration_Utility/article.html

running as admin. Also includes source code if you're curious what's required.

As of 2019, the utility can be downloaded here: https://github.com/tannerhelland/vbAccelerator-Archive/tree/master/VB/Utilities/Type_Library_Registration_Utility



回答2:

Regasm only works for TLB files generated for .NET assemblies. So, you have to use regtlibv12.exe You can find this file in C:\Windows\Microsoft.NET\Framework\v4.0.30319 if you have Visual Studion 2010 installed.



回答3:

Old question, I know, but I thought I'd share what worked for me in case it helps anyone else out.

I needed to register a TLB on Windows Server 2008. I installed the .NET 4.0 framework to get the regtlibv12.exe and that worked. I believe the regtlibv12.exe is also available in the Windows SDK.



回答4:

regtlibv12.exe is not available on Win10 platforms. It has been replaced with TlbExp.exe as found in the corresponding .NET SDK (e.g. "%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\x64\TlbExp.exe" "$(TargetDir)$(TargetFileName)" see https://docs.microsoft.com/en-us/dotnet/framework/tools/tlbexp-exe-type-library-exporter).