Unblocking a DLL on a company machine. How?
Asked Answered
A

6

18

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?

Error 7

Could not load the assembly file:///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=179545 for more information. Mix10.MvvmDemo2

Adjective answered 18/6, 2010 at 18:55 Comment(1)
A
23

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

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.

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".

Alien answered 18/6, 2010 at 19:25 Comment(5)
so you are saying if I just copy the .dll that are blocked to a flash drive and then copy them back they will be unblocked? ill try that.Adjective
@punkouter. Of cause if you copy a file to another drive which not support NTFS all additional steams will be deleted and you will have unblocked file.Rigging
ok did it.. seemed to work! hate this feature! (or sercurity putting restrictions on my machine)Adjective
Use streams.exe -d -s *.* to automate the stream removal for a given directory.Antibaryon
copying into another drive (shared drive on network) & zipping the file worked for me.Emissivity
R
17

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

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

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

streams.exe -d -s *.*

Rarefied answered 12/7, 2011 at 8:8 Comment(0)
R
11

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

Rozanna answered 18/6, 2010 at 19:3 Comment(2)
But there is not option on th ezip file as well to 'unblock' in the properties.... I don't know why I am missing this piece.. i can only guess it has something to do with security at the company?Adjective
I have the same problem. The Unblock button does not appear on the properties dialog. It's probably a security policy that's applied on company computers.Rarefied
R
11

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

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.aspx for more detaild information

Rigging answered 18/6, 2010 at 19:31 Comment(1)
it seems like I don't have permissions to unblock . but I realized mvvmlight is open source so I suppose I can just compile it myself atleast.Adjective
L
2

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

Liberati answered 13/8, 2010 at 6:34 Comment(0)
P
0

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

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.
Popcorn answered 2/1, 2014 at 20:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.