【问题标题】:Automatic resolve nuget reference of dynamic loaded assembly自动解析动态加载程序集的 nuget 引用
【发布时间】:2019-01-19 16:17:47
【问题描述】:

如何自动解析动态加载程序集的 nuget 包。 我有一个带有接口的环境程序集和一个带有实现的程序集。我动态加载实现,但它没有解析实现程序集的 nuget 引用,因为它不在输出文件夹中。 我可以(在调试时)从 C:\Users[Username].nuget\packages 加载程序集吗?

【问题讨论】:

    标签: c# nuget .net-assembly


    【解决方案1】:

    Here's a link to some docs on How to load an assembly at runtime that is located in a folder that is not the bin folder of the application.

    它列出了 3 个选项

    1. 在 GAC 中安装程序集
    2. 使用带有标签的应用程序配置 (.config) 文件
    3. 使用 AssemblyResolve 事件

    这些选项似乎与 .NET Framework 程序集相关。如果您的程序集是 .NET Core,那么一个快速的 google 想出了this which might help。它似乎是 AssemblyResolve 的 .NET Core 等价物,但我只看了 5 秒钟。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-27
      • 2011-09-03
      • 1970-01-01
      • 1970-01-01
      • 2016-10-24
      相关资源
      最近更新 更多