BIN目录下的子目录中的dll文件为何引用不到?

manoen 2008-07-31 10:26:30
大家好!
我的一个asp.net网站,我把一些dll文件放到了网站BIN下的子目录中,为何有些可以引用到,有些引用不到?已经在web.config中添加了如下节点。

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Bin/manoen;Bin/plus"/>
</assemblyBinding>
</runtime>

好像是类库dll放在BIN下的子目录中可以,其它的dll就不行。请懂得这方面原因的朋友帮帮我,谢谢!
...全文
291 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
manoen 2008-07-31
  • 打赏
  • 举报
回复
谢谢ustbwuyi的回复。
我的bin目录结构如下:

\bin\Manoen.Web.test.dll
\bin\manoen\Manoen.Common.dll
\bin\manoen\Manoen.SRM.dll
\bin\manoen\Manoen.Common.dll

\test\test2.aspx

test2.aspx引用Manoen.Web.test.dll,如果把它放到bin下的子目录就会引用不到。Manoen.Web.test.dll引用的Manoen.Common.dll可以引用到。

<%@ Page language="c#" CodeBehind="test.aspx.cs" AutoEventWireup="false" Inherits="Manoen.Web.test.temp" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<table style="width: 100%; height: 100%;">
<tr>
<td style="width:140px;height:100%;" class="borderPadding"><iewc:treeview id="tvTree" width="200px" height="100%" showtooltip="false" runat="server"> </iewc:treeview></td>
</tr>
</table>
</form>
</body>
</html>

namespace Manoen.Web.test {
using System;
using Manoen.Common;
using Manoen.SRM;
using Microsoft.Web.UI.WebControls;

public partial class temp : System.Web.UI.Page {
public string UsernamePwdRequired = string.Empty;
public string t3 = string.Empty;

protected Microsoft.Web.UI.WebControls.TreeView tvTree;

public temp() {
}

//#region 窗体设计代码
protected override void OnInit(EventArgs e) {
this.InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent() {
base.Load += new EventHandler(this.Page_Load);
}
//#endregion

private void Page_Load(object sender, EventArgs e) {
this.InitText();
}

private void InitText() {
//Msg.Alert("哈哈lll");
//dzd sd = new Manoen.SRM.dzd();
Microsoft.Web.UI.WebControls.TreeNode root = new Microsoft.Web.UI.WebControls.TreeNode();
root.ID = "0";
root.Text = "列表";
root.Expanded = true;
this.tvTree.Nodes.Add(root);
for (int i = 0; i < 10; i++) {
Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
node.ID = i.ToString();
node.Text = i.ToString() + "kdkd";
root.Nodes.Add(node);
}
}
}
}

ustbwuyi 2008-07-31
  • 打赏
  • 举报
回复
先放到bin目录下,然后添加从bin目录下添加引用。

一般来说规范的做法都是如此,避免将项目移交给客户后客户无法获取该dll

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧