【发布时间】:2018-07-31 23:17:25
【问题描述】:
我有一个类库 .net 项目(没有配置,没有 exe 文件),我有这样的东西;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
using System.Web.UI.WebControls;
using eBAControls; *<-- I want this dll to be loaded from a path in runtime.*
出于未来的原因,我必须创建copyLocal false,因此我需要能够在运行时引用 dll。与当前 dll 位于同一文件夹中的其他第 3 方 dll 不会导致任何问题,但 eBAControls dll 与当前 dll 不在同一文件夹中,因此会出现错误:Could not load file or assembly 'eBAControls。 ..
由于某些编码和性能原因,我也不能为此使用反射,因此需要将其添加到引用中...
我想要的就是
using eBAControls = @"somepath"; <- that is set dynamically for ex while one of my methods are being executed etc...
【问题讨论】:
-
你别无选择,只能使用某种反射(动态程序集加载/类型解析/等)
标签: c# asp.net .net-assembly