“无法验证的代码未通过策略检查"用于封闭源程序集 [英] "Unverifiable code failed policy check" for a closed source assembly
问题描述
我正在尝试在MSI安装例程中从C#程序中的资源流中动态加载某些(购买的)程序集,但是我收到无法验证代码的策略检查失败".
I'm attempting to dynamically load some (purchased) assemblies from resource streams in a C# program during an MSI installation routine, but I'm getting "Unverifiable code failed policy check".
我在线阅读了一些有关使用/clr:safe编译嵌入式程序集的提示,但我没有该选项.有没有办法解决此政策检查?
I read some tips online about compiling the embedded assembly with /clr:safe, but I don't have that option. Is there a way to work around this policy check?
谢谢.
推荐答案
加载不可验证代码的唯一方法是从完全信任的过程(或可能是应用程序域)中禁用验证.
The only way to load unverifiable code is from a full trust process (or maybe app domain) with verification disabled.
I'm not making this up, one of the C# language designers said "Unverifiable code requires full trust and is generally to be avoided"
这篇关于“无法验证的代码未通过策略检查"用于封闭源程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!