各位高手,請看看這是什麼錯誤
以下的運行樹控件(treeview)時的錯誤,其控件是從網上下下來的一個webcontral的控件,程式是沒有錯的,在別的機器上都沒有錯!我應怎樣處理這樣的錯誤呢??
tks,問題解決就結貼,分不是問題!
Server Error in '/PCI' Application.
--------------------------------------------------------------------------------
File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.UI.WebControls' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///D:/net_root/PCI
LOG: Initial PrivatePath = bin
Calling assembly : PCI, Version=1.0.1411.19920, Culture=neutral, PublicKeyToken=null.
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet.config).
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.0.3705\config\machine.config.
LOG: Post-policy reference: Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/pci/7d12fb3a/ca3f2578/Microsoft.Web.UI.WebControls.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/pci/7d12fb3a/ca3f2578/Microsoft.Web.UI.WebControls/Microsoft.Web.UI.WebControls.DLL.
LOG: Attempting download of new URL file:///D:/net_root/PCI/bin/Microsoft.Web.UI.WebControls.DLL.
LOG: Attempting download of new URL file:///D:/net_root/PCI/bin/Microsoft.Web.UI.WebControls/Microsoft.Web.UI.WebControls.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/pci/7d12fb3a/ca3f2578/Microsoft.Web.UI.WebControls.EXE.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/pci/7d12fb3a/ca3f2578/Microsoft.Web.UI.WebControls/Microsoft.Web.UI.WebControls.EXE.
LOG: Attempting download of new URL file:///D:/net_root/PCI/bin/Microsoft.Web.UI.WebControls.EXE.
LOG: Attempting download of new URL file:///D:/net_root/PCI/bin/Microsoft.Web.UI.WebControls/Microsoft.Web.UI.WebControls.EXE.
Stack Trace:
[FileNotFoundException: File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not found.]
System.Reflection.RuntimeFieldInfo.InternalGetFieldType() +0
System.Reflection.RuntimeFieldInfo.get_FieldType() +53
System.Web.UI.Util.GetNonPrivateFieldType(Type classType, String fieldName) +42
System.Web.Compilation.TemplateControlCompiler.BuildFieldDeclaration(ControlBuilder builder) +27
System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +683
System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +262
System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +262
System.Web.Compilation.TemplateControlCompiler.BuildMiscClassMembers() +51
System.Web.Compilation.PageCompiler.BuildMiscClassMembers() +9
System.Web.Compilation.BaseCompiler.BuildSourceDataTree() +1276
System.Web.Compilation.BaseCompiler.GetCompiledType() +152
System.Web.UI.PageParser.CompileIntoType() +59
System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation() +126
[HttpException (0x80004005): File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not found.]
System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) +828
System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() +125
System.Web.UI.TemplateParser.GetParserCacheItem() +88
System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context) +116
System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +36
System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +14
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +174
System.Web.MapHandlerExecutionStep.Execute() +77
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
问题点数:100、回复次数:11Top
1 楼cdyxh(努力成為一個合格的優秀的oracle dba)回复于 2003-11-13 08:11:45 得分 0
自己頂,高手快來啊!Top
2 楼saucer(思归)回复于 2003-11-13 08:23:54 得分 0
>>>>File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not found
did you install it in the GAC? how did you use it? show some code, or try
<%@ import namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="mytree"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
Top
3 楼cdyxh(努力成為一個合格的優秀的oracle dba)回复于 2003-11-13 08:59:49 得分 0
saucer(思归) 大俠:
是安裝在gac中啊,並且我也有你上面寫的那些代碼,下面我將所有的代碼貼出來,
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Web.UI.WebControls;
using PCI.Component;
namespace PCI.Reports.MatControl
{
/// <summary>
/// MatOdr1TreeView 的摘要描述。
/// </summary>
public class MatOdr1TreeView : System.Web.UI.Page
{
string comp="";
bool com=false;
myOraDataConn myOraConn=new myOraDataConn();
protected Microsoft.Web.UI.WebControls.TreeView TreeView1;
DataTable dt;
private void Page_Load(object sender, System.EventArgs e)
{
// 將使用者程式碼置於此以初始化網頁
if(!IsPostBack)
{
dt=new DataTable();
dt=myOraConn.GetTable("select style_no,art_no from artm order by style_no,art_no");
for(int i=0;i<dt.Rows.Count;i++)
{
if(dt.Rows[i][0].ToString()!=comp)
{
comp=dt.Rows[i][0].ToString();
com=true;
InitTree(TreeView1.Nodes,dt.Rows[i][0].ToString());
}
}
}
}
private void InitTree(TreeNodeCollection Nds,string parentId)
{
DataView dv=new DataView();
TreeNode tmpNd=new TreeNode();
dv.Table=dt;
tmpNd.Text=parentId;
if(com==true)
{
// tmpNd.ImageUrl="../../img/atb_calendar.gif";
tmpNd.NavigateUrl="";
}
else
{
// tmpNd.ImageUrl="../../img/sort.gif";
tmpNd.NavigateUrl="MatOdr1.aspx?styleno="+comp+"&artno="+parentId;
tmpNd.Target="right";
}
Nds.Add(tmpNd);
if(com==true)
{
com=false;
dv.RowFilter="style_no='"+parentId+"'";
foreach(DataRowView drv in dv)
{
InitTree(tmpNd.Nodes,drv["art_no"].ToString());
}
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 此呼叫為 ASP.NET Web Form 設計工具的必要項。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 此為設計工具支援所必需的方法 - 請勿使用程式碼編輯器修改
/// 這個方法的內容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Top
4 楼saucer(思归)回复于 2003-11-13 09:08:41 得分 0
are you sure you have the control on the web server?
on your web server, open a dos window and run
gacutil -l
make sure it is there
...
Microsoft.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null
...Top
5 楼cdyxh(努力成為一個合格的優秀的oracle dba)回复于 2003-11-13 09:18:27 得分 0
to:saucer(思归) 大俠: 下面是我在web服務器上執行的結果:
C:\>gacutil -l | find "WebControls"
Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, Public
KeyToken=31bf3856ad364e35, Custom=null
Microsoft.Web.UI.WebControls.resources, Version=1.0.2.226, Culture=zh-CH
S, PublicKeyToken=31bf3856ad364e35, Custom=nullTop
6 楼realMAX(♂ 困惑的浪漫 ♀)回复于 2003-11-13 09:19:48 得分 5
看来只能是看热闹来了-_-"Top
7 楼saucer(思归)回复于 2003-11-13 09:31:51 得分 0
seems the version doesn't match:
on your server: (1.0.2.226)
Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, Public KeyToken=31bf3856ad364e35, Custom=null
but it is looking for (1.0.2.116)
LOG: DisplayName = Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35Top
8 楼cdyxh(努力成為一個合格的優秀的oracle dba)回复于 2003-11-13 14:38:34 得分 0
to: saucer(思归)
我的兩台機器裝的是同一個安裝程式啊,再說高版本向低版本也應兼容啊,現在的狀況是在一強機器上能運行正常,一台就出現這樣的錯誤.並且兩台機器都是裝的2000 server.Top
9 楼liduke(天下有雪)回复于 2003-11-13 14:50:31 得分 5
gzTop
10 楼saucer(思归)回复于 2003-11-13 20:14:33 得分 90
try to modify your web.config:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.UI.WebControls"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.2.116"
newVersion="1.0.2.226"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Top
11 楼cdyxh(努力成為一個合格的優秀的oracle dba)回复于 2003-11-14 10:38:35 得分 0
非常感謝思歸大俠,問題已解決了,果然是版本不兼容的問題,非常感謝!!Top





