我知道此問題之前已經提出,但可用的解決方案尚未解決我的問題。Visual Studio無法從global.asax加載類型
我有一個global.asax文件,我沒有寫在我的解決方案。 cs文件中的命名空間和類與繼承命名空間和類匹配。
造成問題的原因很簡單:我從解決方案中排除了一個目錄,然後重新包含它。
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'EnableWebApp.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="EnableWebApp.Global" Language="C#" %>
Source File: /global.asax Line: 1
我已經清理,重建,重新安裝這些文件,重新啓動框架,並重新啓動我的系統:從那時起,當我嘗試建立我的解決方案如下錯誤發生。沒有任何東西可以解決它。
的Global.asax 「<%@應用代碼隱藏=」 Global.asax.cs中 「繼承= 」EnableWebApp.Global「 語言= 」C#「 %>」
的Global.asax.cs 命名空間EnableWebApp { 公共類全球:System.Web.HttpApplication {
程序集名稱爲EnableWebApp。這些文件中沒有任何內容會導致此錯誤。 – stevenpepe
您在Global中是否有任何代碼,還是僅僅是文件本身?技術上你不需要它。如果您確實有代碼,可能會將其備份到某處,然後刪除該文件並嘗試運行您的項目。如果它在沒有全局文件的情況下運行,則通過Visual Studio添加一個新的文件並再次粘貼代碼。 – ewitkows