visual-studio 解锁公司机器上的 DLL。如何?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3072359/
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-10-22 12:07:57  来源:igfitidea点击:

Unblocking a DLL on a company machine. How?

visual-studiodllmvvm-light

提问by punkouter

I am trying to test out MVVMLight but the DLLs that come with it are BLOCKED. I have read about it and I am told to click the UNBLOCK in the file property.. but that doesnt exist for me.. Then I found out of a program called STREAMS that is suppose to unblock.. that didnt work... any other idea how to fix this?

我正在尝试测试 MVVMLight,但它附带的 DLL 已被阻止。我已经阅读了它,并且有人告诉我单击文件属性中的 UNBLOCK .. 但这对我来说并不存在.. 然后我发现了一个名为 STREAMS 的程序,它应该可以解除阻塞.. 没有工作......任何其他想法如何解决这个问题?

Error 7

错误 7

Could not load the assembly file:///C:\MIX10-MVVM-Samples\Mix10.MvvmDemo2 - End\Mix10.MvvmDemo2\Bin\Debug\GalaSoft.MvvmLight.Extras.SL4.dll

无法加载程序集文件:///C:\MIX10-MVVM-Samples\Mix10.MvvmDemo2 - End\Mix10.MvvmDemo2\Bin\Debug\GalaSoft.MvvmLight.Extras.SL4.dll

. This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545for more information. Mix10.MvvmDemo2

. 该程序集可能是从 Web 下载的。如果程序集是从 Web 下载的,Windows 会将其标记为 Web 文件,即使它驻留在本地计算机上。这可能会阻止它在您的项目中使用。您可以通过更改文件属性来更改此名称。仅取消阻止您信任的程序集。有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=179545。Mix10.MvvmDemo2

回答by Hans Passant

The file contains an alternate data stream that indicates that the content was retrieved from the Internet and is not secure. This is a feature of the NTFS file system, one that's unfortunately well hidden because Explorer has no support for showing their content. You can see them from the command prompt with the DIR /R command option. And type their content with TYPE filename:streamname. And delete them with DELETE filename:streamname

该文件包含一个备用数据流,表明该内容是从 Internet 检索的并且不安全。这是 NTFS 文件系统的一项功能,不幸的是,由于资源管理器不支持显示其内容,因此该功能被很好地隐藏了。您可以使用 DIR /R 命令选项从命令提示符查看它们。并使用 TYPE filename:streamname 键入它们的内容。并使用 DELETE filename:streamname 删除它们

Other tricks is to copy the file to a file system that doesn't support alternate data streams, that slices them off the file. A flash drive for example. Or a zip utility.

其他技巧是将文件复制到不支持备用数据流的文件系统,从而将它们从文件中分离出来。例如闪存驱动器。或 zip 实用程序。

Later versions of Windows, I think starting with Win7, has built-in support for this in Explorer. Right-click the file, Properties and click "Unblock".

我认为从 Win7 开始,更高版本的 Windows 在资源管理器中内置了对此的支持。右键单击文件,属性,然后单击“取消阻止”。

回答by Mas

SysInternals has a great command line utility called Streams. This proved very useful for me.

SysInternals 有一个很棒的命令行实用程序,称为Streams。这证明对我非常有用。

Streams v1.56 - Enumerate alternate NTFS data streams Copyright (C) 1999-2007 Mark Russinovich Sysinternals - www.sysinternals.com

usage: streams [-s] [-d] <file or directory>
-s Recurse subdirectories
-d Delete streams

Streams v1.56 - 枚举备用 NTFS 数据流 版权所有 (C) 1999-2007 Mark Russinovich Sysinternals - www.sysinternals.com

用法:流 [-s] [-d] <文件或目录>
-s 递归子目录
-d 删除流

Execute the following command in the directory you wish to remove streams from (same effect as copying to USB/FAT32 drive)

在要删除流的目录中执行以下命令(与复制到USB/FAT32驱动器效果相同

streams.exe -d -s *.*

streams.exe -d -s *.*

回答by Oleg

Only for general understanding. NTFS supports streams (see http://msdn.microsoft.com/en-us/library/aa364404%28VS.85%29.aspx). The full name of a stream is filename:stream_name:stream_type. So one can easy write some additional information about a file in an additional stream of file. If you download a file from the internet Internet Explorer write some simple information in a stream with the name Zone.Identifier. If you have a file test.dll downloaded from the internet you can use

仅供大体了解。NTFS 支持流(请参阅http://msdn.microsoft.com/en-us/library/aa364404%28VS.85%29.aspx)。流的全名是filename:stream_name:stream_type。因此,可以轻松地在附加文件流中写入有关文件的一些附加信息。如果您从 Internet Explorer 下载文件,请在名称为 的流中写入一些简单的信息Zone.Identifier。如果您有从互联网下载的文件 test.dll,您可以使用

more < test.dll:Zone.Identifier

to see information from the stream. You will see something like

查看来自流的信息。你会看到类似的东西

[ZoneTransfer]
ZoneId=3

Unblocking is not much more as deleting of this stream. I recommend you to read http://weblogs.asp.net/dixin/archive/2009/03/14/understanding-the-internet-file-blocking-and-unblocking.aspxfor more detaild information

解除阻塞并不比删除这个流更重要。我建议您阅读http://weblogs.asp.net/dixin/archive/2009/03/14/understanding-the-internet-file-blocking-and-unblocking.aspx以获取更多详细信息

回答by Otávio Décio

Unblock the zip file first, and then extract the dll's. Actually that's what they instruct to do here.

首先解压缩 zip 文件,然后解压缩 dll。实际上,这就是他们在这里指示要做的事情

回答by David Perlman

I simply opened the dll file in notepad++ and saved it with a different name.

我只是在记事本++中打开了 dll 文件并用不同的名称保存了它。

回答by Jim G.

If it helps anyone, I pulled down two blocked DLLs from TFS.

如果它对任何人有帮助,我从 TFS 中提取了两个被阻止的 DLL。

My solution:

我的解决方案:

  • Inside of Windows Explorer, delete the two blocked DLLs.
  • Inside of TFS, do a 'Get Specific Version' operation on the folder, and make sure that 'Overwrite all files even if the local version matches the specified version' is checked so that you will pull down fresh copies of the deleted DLLs.
  • Rebuild your solution.
  • 在 Windows 资源管理器中,删除两个被阻止的 DLL。
  • 在 TFS 内部,对文件夹执行“获取特定版本”操作,并确保选中“即使本地版本与指定版本匹配也覆盖所有文件”,以便您将删除已删除 DLL 的新副本。
  • 重建您的解决方案。