How can I check if a library (dll) is available in C#?

后端 未结 2 1172
感情败类
感情败类 2021-01-27 04:25

How do I check if a library (dll) is available at runtime before I call it?

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-27 04:51

    The AppDomain.AssemblyLoad and AppDomain.AssemblyResolve events occur on load and load failure, respectively. If you handle these events you can determine which assemblies loaded and which failed.

提交回复
热议问题