解决'无法加载类型'错误

时间:2013-02-27 17:36:48

标签: c# visual-studio debugging visual-studio-2012

我一直试图修复这个错误数小时,我尝试了所有我无法成功的事情。我是C#的新手。我想知道是否有人可以帮我确定如何开始解决此错误?

错误讯息:

Could not load type 'Inventory1.Global'.    W:\admin.fctl.ucf.edu\inventory\Global.asax 1   

Global.asax内容:

<%@ Application Codebehind="Global.asax.cs" Inherits="Inventory1.Global" Language="C#"%>

Global.asax.cs内容:

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace Inventory1 
{
    /// <summary>
    /// Summary description for Global.
    /// </summary>
    public class Global : System.Web.HttpApplication
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        public Global()
        {
            InitializeComponent();
        }   

        protected void Application_Start(Object sender, EventArgs e)
        {

        }

        protected void Session_Start(Object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(Object sender, EventArgs e)
        {

        }

        protected void Application_EndRequest(Object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(Object sender, EventArgs e)
        {

        }

        protected void Application_Error(Object sender, EventArgs e)
        {

        }

        protected void Session_End(Object sender, EventArgs e)
        {

        }

        protected void Application_End(Object sender, EventArgs e)
        {

        }

        #region Web Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {    
            this.components = new System.ComponentModel.Container();
        }
        #endregion
    }
}

1 个答案:

答案 0 :(得分:0)

该代码适用于我的机器。检查以确保/ bin目录中存在Dll。此外,请确保bin和Global.asax文件存在于应用程序的根目录中。很可能服务器级别的某些人在IIS中改变了一些东西。