2010-08-10 102 views
3

在我的網頁我有:ASP.net C# - 未能加載類型

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="siteSettings.aspx.cs" Inherits="APack.admin.siteSettings" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 

    </div> 
    </form> 
</body> 
</html> 

我後面的代碼是:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 

namespace APack.admin 
{ 
    public partial class siteSettings : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 

     } 
    } 
} 

它拋出該異常:

Parser Error Message: Could not load type 'APack.admin.siteSettings'. 

這只是在Visual Studio中生成,右鍵單擊 - >新文件。它只是不工作:(任何想法?

回答

10

有你構建的應用程序?

+0

我的印象是,當我從服務器運行網頁時,它爲你編譯? – 2010-08-10 10:03:46

+0

不知道爲什麼它的工作,但它沒有:)謝謝!任何解釋? – 2010-08-10 10:14:59

+0

「網站」項目即時編譯。 「Web應用程序」項目不是。 – 2010-08-10 10:17:39

1

我想我已經找到了可能的解決方案之一,點擊「項目名稱」,「屬性」,然後將其命名「根命名空間」到Web應用程序的名稱,如‘YourNamespace’,然後重新編譯DLL

+0

似乎沒有改變任何東西 – 2010-08-10 10:09:23

相關問題