【问题标题】:bindingRedirect in Shell Extension Not WorkingShell 扩展中的 bindingRedirect 不起作用
【发布时间】:2014-09-28 19:41:20
【问题描述】:

我编写了一个调用 Google Drive API v2 来下载文件的 shell 扩展。它抱怨程序集版本,即它需要 System.Net.Http.Primitives,Version=1.5.0.0,即使 .dll.config 文件中已经存在 bindingRedirect 规则。另请注意,相同的 bindingRedirect 在放置在 machine.config 文件中时可以完美运行。这是某种错误吗?

【问题讨论】:

  • 我怀疑是应用级别的配置。
  • @Athari,我检查了应用程序级别的配置,即应用程序安装目录中的 app.dll.config,似乎一切正常。谢谢
  • 所以你是说它在你的机器上工作,但在另一台机器上不行?还是只是您将 bindingRedirect 移至更高级别的配置?
  • @code4life,只有当我将 bindingRedirect 规则添加到 machine.config 文件时,它才能在我的机器上运行。
  • 现在我发现 explorer.exe.config 也适用于 bindingRedirect,但我希望它从应用程序 config.file 中读取重定向规则

标签: .net .net-assembly google-drive-api machine.config assembly-binding-redirect


【解决方案1】:

我通过写这个解决了这个问题:

 AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
 {
      var assembly = Assembly.Load("System.Net.Http.Primitives");

      return assembly;
 };

【讨论】:

    猜你喜欢
    • 2018-12-30
    • 1970-01-01
    • 2011-12-01
    • 2015-09-23
    • 2012-06-20
    • 1970-01-01
    • 2014-11-30
    • 2014-02-20
    • 2019-03-21
    相关资源
    最近更新 更多