我有一个 asp.net 网站项目。我需要使用几个无法复制到 bin 目录中的自定义 dll。
我尝试创建一个自定义 bin 文件夹并将 Global.asax 中的 Application_Start PrivateBinPath 设置为该目录
void Application_Start(对象发送者,EventArgs e)
{
AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = Server.MapPath("~/my_DLLS");
}
然后在我的 .cs 文件中使用 using 语句包含该 dll,但我收到编译器错误消息:CS0246:找不到类型或命名空间名称“DLLNAME”(您是否缺少 using 指令或程序集引用?)
我还尝试在 web.config 中添加 assemblyBinding
<运行时>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="my_DLLS" />
</汇编绑定>
</运行时>
我觉得我错过了一些东西。