更新时间:2023-02-10 08:18:00
如果您参考文档, AppDomain.GetAssemblies Method(System) [ ^ ],它读取,获取已加载到此应用程序域的执行上下文中的程序集。
添加引用实际上并不加载程序集。您必须在代码中使用它才能加载它。
如果您在项目中添加了引用,则不要使用Reflection来加载它,只需创建一个新的类实例并从那里开始。
If you refer to the documentation, AppDomain.GetAssemblies Method (System)[^], it reads, "Gets the assemblies that have been loaded into the execution context of this application domain."
Adding a reference does not actually load the assembly. You would have to be using it in code somewhere for it to get loaded.
If you added a reference in your project then don't use Reflection to load it, just create a new instance of the class and go from there.