This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22076|Reply: 0

[Source] .net/c# assembly fails to load the dll solution for the network

[Copy link]
Posted on 11/2/2018 5:06:43 PM | | | |
Attempting to load an assembly from a network location, which in earlier versions of the .NET Framework resulted in sandboxing of the assembly. This release of the .NET Framework does not have CAS policies enabled by default, so this loading can be dangerous. If this load is not intended to sandbox the assembly, enable the loadFromRemoteSources switch. For more information, seeThe hyperlink login is visible.



Solution:

[Method 1]

According to the prompt, found an article from MSDN. The solution given in the article is: Add the following xml snippet to the program's configuration file:


Following this solution, the program works correctly.
MSDN link:The hyperlink login is visible.(VS.100).aspx。

[Method 2]

The Assembly class has a static function, UnsafeLoadFrom, which does not perform any security checks when loading an assembly. Modify the original code as follows:


[Method 3]

Assembly's load method has a lot of overloads, and you can use one of the load functions with byte[] parameters. The code is as follows:







Previous:Thailand Cow PHP Big Bull Class + Basic Class Full Set of Video Tutorials More than 500 episodes of PHP comprehensive practical video...
Next:Rogue software haozip analysis
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com