显示层浏览时出现这种错误,找了半天不知道怎么办?
在业务层,我是用如下代码建了一个类,但在显示层引用就不正常。namespace BusinessLogicLayer
{
    /// <summary>
    ///ARTclass 文章分类
    /// </summary>
    public class ARTclass
    {
        private int _id = 0;
        private string _als_Type = string.Empty;
        private int _als_ParentID = 0;
        private string _als_ParentStr = string.Empty;
        private int _als_Depth = 0;
        private int _als_RootID = 0;
        private int _als_Child = 0;
        private int _als_NextID = 0;
        private int _als_orders = 0;
....................
下面是显示层控件:
        <asp:ObjectDataSource ID="DB_artclass" runat="server" 
        DeleteMethod="DeleteAls_class" InsertMethod="InsertAls_class" 
        SelectMethod="SelectAls_class" TypeName="BusinessLogicLayer.ARTclass
        UpdateMethod="UpdateAls_class">
        </asp:ObjectDataSource>于是又在显示层顶加了一句:
<%@ Register TagPrefix="ARTclass" Namespace="BusinessLogicLayer" Assembly="BusinessLogicLayer" %>结果出现如下错误:“/c”应用程序中的服务器错误。
--------------------------------------------------------------------------------分析器错误 
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误消息: 未能加载文件或程序集“BusinessLogicLayer”或它的某一个依赖项。系统找不到指定的文件。源错误: 
行 1:  <%@ Page Title="" Language="C#" MasterPageFile="manage.master" AutoEventWireup="true" CodeFile="manage_art.aspx.cs" Inherits="manage_manage_art" %>
行 2:  <%@ Register TagPrefix="ARTclass" Namespace="BusinessLogicLayer" Assembly="BusinessLogicLayer" %>行 3:  
行 4:  <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content>
 源文件: /c/ITcom/FcomV2.0n/manage/manage_art.aspx    行: 2 程序集加载跟踪: 下列信息有助于确定程序集“BusinessLogicLayer”无法加载的原因。
警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
请问我的问题在哪里,应该怎么理解错误的原因?这个问题在使用软件本身启动调试功能没有错误,但在IIS中调试就出现了错误。

解决方案 »

  1.   

    从你的描述中,看不出为什么要有<%@ Register TagPrefix="ARTclass" Namespace="BusinessLogicLayer" Assembly="BusinessLogicLayer" %> 这一句。这一句是多余的。你的 ARTclass 又不是自定义控件。如果真的是自定义控件,你把控件放入vs工具箱然后用鼠标拖入页面就可以自动产生类似这类描述。而如果不是控件,你根本不应该写这一句。将你的那个project与网站放在同一个解决方案中,在你的网站上“添加引用->项目”然后选择这个project。之后,你的ObjectDataSource就会找到你的网站引用的 BusinessLogicLayer.ARTclass 类型,用不着多写别的。
      

  2.   


    这一句我本来没加上,按我原来ObjectDataSource所写的那样出现如下错误:
    未能找到在 ObjectDataSource“DB_artclass”的 TypeName 属性中指定的类型
    可是我使用软件本身的启动调试,没错误一切正常,就是使用IIS后出这问题,上传到虚拟主机也是一样的错误。
    本来使用设计视图为ObjectDataSource配置的数据源,都能找到组件名称,但为什么不能在IIS上测试通过,是我的系统有毛病,还是程序有问题?谢谢了~~~我是新手~~