After searching half the night for Precompiled .net 4.0 app wont run on other windows installations (error: trying to load assembly from network address) I figured out that I just had to click the "unblock" button. Like stated in the answer I cant expect everybody to know this so someone will just think its not working and drop the app. I will add kind of manual but is there a way to automate this?
-
To answer your question, you will need to debug this, look at where the block is being identified and then write your code to fix this. On a side note, this is not a good question, and without any code in the question we are extremely limited in what help we can give you. – Simon Price Feb 13 '20 at 07:35
-
1It is usual C# behavior for user protection so no need to "fix" it, i just want to come over it! https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/dd409252(v=vs.100)?redirectedfrom=MSDN – banner Feb 13 '20 at 07:38
2 Answers
This is a flag that is added to the assembly by the Explorer. I think the easiest way to overcome this problem would be to store your assembly as a compressed zip archive on the network location and then unzip it to the local path where you need it.

- 5,626
- 1
- 23
- 44
-
Are you sure that the Windows ZIP extractor won't add the flag to extracted files if it's set on the ZIP file? – Paul Kertscher Feb 13 '20 at 07:49
-
@PaulKertscher In your app, you are going to use the assemblies. So, just unzip the assemblies in your app. If you use the Windows Explorer for this, it will just as well maintain the flag. – Georg Feb 13 '20 at 08:22
According to this answer downloaded files are marked as files from remote sources and Windows / .NET will block them.
Possibly Georgs answer will work out, but YMMV depending on how you extract the zipped files. Another possibility (that I assume that would work) is creating an installer, e.g. with Inno Setup. This will extract the executable files (including DLLs) and they should not be marked as downloaded from the internet. The users may experience a message that says that the installer itself was downloaded, but it should be possible for them to install the software.

- 9,416
- 5
- 32
- 57
-
I also thought about an installer. Maybe its the simplest and easiest solution. – banner Feb 13 '20 at 08:08