【问题标题】:Signed assembly seems to be loading unsigned (not using reflection)签名程序集似乎正在加载未签名(不使用反射)
【发布时间】:2012-07-31 22:35:17
【问题描述】:

我有三个 .NET 4.0 第三方程序集:

  • Assembly.One 未签名并引用已签名的Assembly.Two 和未签名的Assembly.Three

  • Assembly.Two 引用了一个签名 Assembly.Three

我已经使用反射器验证了上述内容。

我收到了未签名的Assembly.One、已签名的Assembly.Two未签名 Assembly.Three

我预计这会在部署时失败,因为签名的Assembly.Two 肯定无法加载未签名的Assembly.Three,因为它专门从参考中寻找签名版本?然而,令我惊讶的是它确实有效。

Assembly.Two 在其清单中有对Assembly.Three 的引用,因此它必须使用它,否则编译器会将其剥离?我检查了服务器上没有Assembly.Three 的签名版本,并且使用 FUSLOGVW 它确实在加载未签名版本。

FUSLOGVW 中有两个条目用于加载未签名的Assembly.Three,其中一个用于 (Unknown) 的调用程序集,显示如下。

应用程序成功绑定了部分指定的程序集 目录。需要重新申请政策

是否存在潜在的“责任链”(由于缺乏更好的描述),因为原始 Assembly.One 引用了未签名的 Assembly.Three,所以我不知道这一点?

【问题讨论】:

    标签: .net assemblies


    【解决方案1】:

    您在 app.config、Machine.Config 等中是否有任何“已配置的程序集”执行重定向?或其他配置设置来改变行为?

    检查以确保对程序集的引用中的“特定版本 = true”。您是否在项目中引用 Unsigned Assembly.Three 来强制“复制”,但实际上并没有直接使用 Three?确保在您对Three 的本地引用开始之前加载Assembly.Two,或者根本不引用三直接让Two 做出决定。

    在此处加载信息 How the Runtime Locates Assemblies 来自此信息 #2 可能是您正在发生的事情。

    【讨论】:

      猜你喜欢
      • 2011-05-19
      • 1970-01-01
      • 2011-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多