2013-02-27 151 views
0

我一直試圖解決這個錯誤幾個小時,我嘗試了一切,我可以這樣做沒有成功。我真的是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 
    } 
} 
+0

MiGusta,這是你正試圖修復遠程服務器或本地機器上的代碼..也有一個'W:\'驅動器在你試圖運行/調試這個機器上。你甚至可以調試代碼..?或者你只是在做一個代碼並運行類型的場景..? – MethodMan 2013-02-27 17:39:33

+0

遠程服務器。我正在調試過程中。我想要做的是在Visual Studio中重建'Inventory'項目並創建一個新的.dll文件,因爲舊的應用程序已停機數天。所以我需要調試這個代碼才能重建,這是我一直想要做的一段時間。上面的錯誤是我得到的唯一錯誤。 – AnchovyLegend 2013-02-27 17:41:18

+0

那麼你的本地機器從哪裏運行(當你試圖調試時)呢? – CodingGorilla 2013-02-27 17:43:27

回答

0

該代碼工作在我的機器上。檢查以確保Dll存在於/ bin目錄中。另外,請確保bin和Global.asax文件存在於應用程序的根目錄中。服務器級別的人很可能在IIS中改變了某些東西。

+0

Josh通過'在IIS中更改了某些內容「,您是否指OP中​​的虛擬目錄路徑..? – MethodMan 2013-02-27 17:45:31

+0

舊的.dll錯誤/過時並導致應用程序崩潰。我正在嘗試創建一個新的庫重建庫存項目,那麼解決此問題的好方法是什麼? – AnchovyLegend 2013-02-27 17:48:43

+0

@DJKRAZE - 是。有時候,如果開發人員不知道它的路徑,那麼它們就不會在根目錄中工作。 – Josh 2013-02-27 19:16:57

相關問題