regtlibv12怎么了? [英] What happened to regtlibv12?

查看:370
本文介绍了regtlibv12怎么了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个分区上全新安装了Windows 8,并安装了Visual Studio 11/2012 Professional,但在内找不到 regtlibv12.exe C:\Windows\Microsoft.NET\Framework\v4.0.30319



下面是我的Windows 7分区的屏幕截图,以及.Net 4.0(和regtlibv12):





下面是带有.Net 4.5(且没有regtlibv12)的Windows 8:





regtlibv12 不再是.Net框架的一部分吗?我还需要安装.Net 4.0吗?如果我在4.5之上安装了.Net 4.0,会发生什么?我知道它们都位于硬盘驱动器上的同一位置,并且4.5有效地覆盖了4.0,而Windows 8上的默认值为4.5。我需要安装4.0,然后重新安装4.5以获得 regtlibv12 返回?



谢谢

解决方案

框架。而且它完全没有证件。然而,有一个非常一致的谣言,很多程序员已经在其v2.0.50727或v4.0.30319目录中找到了它,并发现它可以解决注册问题。



在这些文件夹中显示的确切方式很难进行逆向工程,我所见的唯一模式是它将自己安装框架时在那儿。当框架预先安装在计算机上时,就不会出现。从某种意义上讲,框架目录中有几个.tlb文件需要注册。它们包含客户端代码可能依赖的.NET [ComVisible]类型的类型信息。由于这些.tlb文件未嵌入在常规COM服务器中,因此普通的注册类型库不适用于这些.tlb文件。额外的猜测是,在预安装的.NET版本中不需要该工具,因为注册信息已汇总到常规Windows安装程序中。



如果您已经对工具有了依赖性,那么除了从另一台计算机复制.exe之外,您就无法做其他事情。或解决需要从另一端使用它的原因,这样就不再需要它:




  • 这是一个忘记与Regasm.exe一起使用/ tlb选项的解决方法。当客户端代码尝试使用另一个线程的COM接口时,这可能会在运行时产生TYPE_E_CANTLOADLIBRARY错误。类型库提供标准编组器编组方法参数所需的类型信息。使用/ tlb选项可解决此问题。


  • 这是一种解决方法,可让COM服务器显示在项目+添加引用的 COM选项卡中。该选项卡列出了注册的类型库。但是,这不是一个适当的解决方法,除了在构建服务器上之外,您可以编译代码,但由于注册未完成而无法运行。正确的方法是使用作者提供的安装程序,或在紧急情况下使用Regsvr32.exe,以便注册类型库和CLSID密钥。


  • <对于未注册其类型库的COM服务器,这是一种解决方法。与上述类似,但是注册类型库是可选的,通常仅在您的dev机器上需要,而在运行服务器的机器上则不需要。大多数可以使用类型库的工具都有一种显式添加它们的方法,而不必依赖TypeLib注册表项。 Visual Studio IDE也是如此,您可以使用浏览选项卡来直接选择.tlb文件。



I have a clean install of Windows 8 on a partition, with Visual Studio 11/2012 Professional installed and I cannot find regtlibv12.exe inside C:\Windows\Microsoft.NET\Framework\v4.0.30319.

Below is a screenshot of my Windows 7 partition, with .Net 4.0 (and regtlibv12):

Below is Windows 8 with .Net 4.5 (and no regtlibv12):

Is regtlibv12 no longer a part of the .Net framework? Do I need to install .Net 4.0 as well? What would happen if I installed .Net 4.0 over the top of 4.5? I know that they both go to the same location on the hard drive, and 4.5 effectively overwrites 4.0, and 4.5 comes as default on Windows 8. Would I need to install 4.0, and then re-install 4.5 to get regtlibv12 back?

Thanks

解决方案

It was never part of the framework. And it is entirely undocumented. There is however a very consistent rumor that it is, lots of programmers have found it in their v2.0.50727 or v4.0.30319 directories and figured out that it could solve registration problems. Lots of forum posts mention it.

The exact way it shows up in those folders is hard to reverse-engineer, the only pattern I've seen is that it will be there when you install the framework yourself. And won't be there when the framework is pre-installed on the machine. Which somewhat makes sense, there are several .tlb files in the framework directory that need to be registered. They contain type info for .NET [ComVisible] types that client code may have a dependency on. The normal way type libraries get registered does not apply for those .tlb files since they are not embedded in a regular COM server. With the additional guess that the tool isn't needed in a pre-installed version of .NET because the registration info is rolled-up into the regular Windows setup.

If you've gotten yourself into a dependency on the tool then you can't do much beyond copying the .exe from another machine. Or tackle the reason you need to use it from the other end so you don't need it anymore:

  • it is a workaround for forgetting to use the /tlb option with Regasm.exe. That may produce a TYPE_E_CANTLOADLIBRARY error at runtime when client code tries to use a COM interface from another thread. The type library provides the type info that the standard marshaller needs to marshal the arguments of the method. Use the /tlb option to fix that.

  • it is a workaround for getting COM servers to show up in the Project + Add Reference, COM tab. That tab lists registered type libraries. It is however not a proper workaround, other than on build servers, you can compile your code but you can't run it since the registration is not complete. The proper way to do it is by using the author's provided installer or by using Regsvr32.exe in a pinch so both the type library and the CLSID keys get registered.

  • it is a workaround for COM servers that don't register their type library. Similar as above, but registering type libraries is optional and typically only required on your dev machine, not on the machine that runs the server. Most tools that can consume type libraries have a way to add them explicitly rather than depend on the TypeLib registry key. So does the Visual Studio IDE, you can use the Browse tab instead to select the .tlb file directly.

这篇关于regtlibv12怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆