windows 在没有程序集清单的情况下在 GAC 中注册 DLL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/636850/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:08:29  来源:igfitidea点击:

Register DLL in GAC without Assembly Manifest

windowsvisual-studio-2010gacutil

提问by tsilb

I have a DLL I wish to register with my GAC. I enter the command:

我有一个 DLL,我希望在我的 GAC 中注册。我输入命令:

gacutil /i c:\temp\msvcr100.dll

and I get the error:

我得到错误:

Failure adding assembly to the cache:   The module was expected to contain an as
sembly manifest.

All I have is the DLL. Is there a way to create / fake / bypass it?

我所拥有的只是 DLL。有没有办法创建/伪造/绕过它?

For those interested, I am attempting to extract the Visual Studio 2010 & .NET 4.0 CTP from the VHD and run it on my physical box. As a side note, has this been attempted?

对于那些感兴趣的人,我正在尝试从 VHD 中提取 Visual Studio 2010 和 .NET 4.0 CTP 并在我的物理机上运行它。作为旁注,是否尝试过?

回答by Erik A. Brandstadmoen

Is this actually a GAC-able DLL? It doesn't seem like it. Maybe it's just reg-able? Why do you want to GAC it?

这实际上是一个支持 GAC 的 DLL 吗?好像不是。也许它只是可以注册?你为什么要GAC呢?

回答by Jason Short

"For those interested, I am attempting to extract the Visual Studio 2010 & .NET 4.0 CTP from the VHD and run it on my physical box. As a side note, has this been attempted?"

“对于那些感兴趣的人,我正在尝试从 VHD 中提取 Visual Studio 2010 和 .NET 4.0 CTP 并在我的物理机上运行它。作为旁注,是否有人尝试过?”

FYI - At this point there is a full ISO image of Beta 1 you can download and legally run on your desktop if you want.

仅供参考 - 此时有 Beta 1 的完整 ISO 映像,您可以根据需要下载并在桌面上合法运行。

VS 2010 beta 1 on MSDN

MSDN 上的 VS 2010 beta 1

It is only for MSDN subscribers at this point though. Will be added to Microsoft downloads later.

不过,它目前仅适用于 MSDN 订阅者。稍后将添加到 Microsoft 下载中。

EDIT: It is now open for all to download

编辑:它现在开放供所有人下载

回答by Benjol

I've experienced this with (apparently) corrupt dlls (I assume failed copies from USB drives).

我经历过(显然)损坏的 dll(我假设从 USB 驱动器复制失败)。

回答by Dаn

Are you sure that "extract[ing] the Visual Studio 2010 & .NET 4.0 CTP from the VHD" doesn't violate the license agreement? If Microsoft wanted you to "run it [VS2010] on my physical box", they would have just made it available as a noraml install.

您确定“从 VHD 中提取[ing] Visual Studio 2010 和 .NET 4.0 CTP”没有违反许可协议吗?如果微软想让你“在我的物理机器上运行它 [VS2010]”,他们就会将它作为 noraml 安装提供。

回答by i_am_jorf

If you can create the manifest (I'm not sure what one should look like) it's easy enough to just load the DLL into Visual Studio's resource editor (File->Open->File->[select dll]->[click down chevron on the Open button]->Resource View) and just add the manifest to the dll.

如果您可以创建清单(我不确定它应该是什么样子),只需将 DLL 加载到 Visual Studio 的资源编辑器(文件->打开->文件->[选择 dll]->[点击下打开按钮上的 V 形]->资源视图),然后将清单添加到 dll 中。

回答by Nick Devereaux

I suppose the same process is done when you drag and drop to C:\Windows\assembly?

我想当您拖放到 C:\Windows\assembly? 时会完成相同的过程?