0

I have a C# application that is available online for download. However, when customers download it, there is a one .dll that I created which SOMETIMES becomes "blocked" and needs to be "unblocked" by going to the file properties and clicking unblock. The.exe won't run because this. I cannot figure out why Windows decides to block it.

I know that I can programmatically unblock the file as well by using Unblock-File in PowerShell or Streams.exe. I also know that by editing the ZoneIdentifier of a file, I can MANUALLY block files in order to somewhat reproduce the issue. I cannot however reproduce the issue by download. I've tried downloading my program from the website in Win10 & Win7, and have even edited the "Do not preserve zone information in file attachments" in gpedit as well, all to no avail.

My question is, why is it that SOMETIMES my .dll gets blocked when downloaded from the internet? How can I prevent this block from happening, by digitally signing the dll?

Am I doing something wrong when I package my C# solution? Is there a way to reproduce a particular download from being blocked?

Tarik
  • 11
  • 2
  • 1
    What exactly customers are downloading and how? *"when I package my C# solution"* - what is packaging? – Sinatr Jul 12 '19 at 14:52
  • Windows blocks any downloaded bits to prevent security risks. So you shouldn't host binaries for download, but an installer (like MSI). – Lex Li Jul 12 '19 at 18:24
  • @LexLi They are .NET Framework 4.5 applications which run on both Windows and Linux. This is why an MSI in this case is not used. – Tarik Aug 14 '19 at 18:17
  • @Sinatr When I **build** my c# solution, I zip the bin/release folder and put it on the site for download. – Tarik Aug 14 '19 at 18:19
  • See [this answer](https://stackoverflow.com/a/3072508/1997232). – Sinatr Aug 15 '19 at 07:10

1 Answers1

0

I don't know the reason. As far as I know, if you download any unknown dll or executable (specially in Chrome), it will be blocked and you can't use that binary file in your project until you unblock it.

Solution: Take dll and whatever you have in a zip or rar file. Then download and extract the zip file in the customer system. Even some Microsoft binaries are delivered in zip format. Consider looking at Process Explorer.

Amir Pourmand
  • 519
  • 6
  • 17