2013-11-04 44 views
0

我正在使用Visual Studio 2012上傳我的網站,並無法使其顯示在我的域中。一切都上傳到GoDaddy ftp。我跟GoDaddy交談過,他們說我的global.asax文件導致了這個問題。但他們不能確切地告訴我是什麼,因爲他們不是代碼專家。他證實了global.asax是問題,而不是web.config文件。我在下面提供了我的global.asax文件。任何幫助都很棒,所以我可以讓這個網站發佈並在我的域名上工作。謝謝!ASP.NET GoDaddy.com上的global.asax問題

Imports System.Web.Optimization 

Public Class Global_asax 
Inherits HttpApplication 

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires when the application is started 
    BundleConfig.RegisterBundles(BundleTable.Bundles) 
    AuthConfig.RegisterOpenAuth() 
    RouteConfig.RegisterRoutes(RouteTable.Routes) 
End Sub 

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires at the beginning of each request 
End Sub 

Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires upon attempting to authenticate the use 
End Sub 

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires when an error occurs 
End Sub 

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires when the application ends 
End Sub 
End Class 
+0

究竟是什麼,你所得到的錯誤? –

+0

找不到頁面。它就像它甚至沒有讀我的代碼。但GoDaddy確認這是我的global.asax文件。並確認服務器端正常運行。如果我使用手機查找網站,那麼我找不到網頁。 502錯誤的網關響應錯誤。不知道這是否有幫助,但這一切都得到了。它就像它不存在。我從VS 2010運行項目,我可以很好地上傳,但2012年似乎是它造成的問題。 – user2722517

+0

這是一個Web窗體應用程序,對不對?假設你有一個default.aspx頁面,如果你輸入http://domain.com/default.aspx,你會得到錯誤?該錯誤是IIS錯誤或「應用程序中的服務器錯誤」? –

回答

0

嘗試添加一個空的Global.asax文件,例如,評論它的所有代碼行,因爲它在下面的代碼片段中。

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) 
    ' Fires when the application is started 
    ' BundleConfig.RegisterBundles(BundleTable.Bundles) 
    ' AuthConfig.RegisterOpenAuth() 
    ' RouteConfig.RegisterRoutes(RouteTable.Routes) 
End Sub 

下一步是取消一個註釋,然後檢測導致錯誤的註釋。

0

添加以下行到你的web.config文件

<system.webServer> 
<modules runAllManagedModulesForAllRequests="true"> 
</modules> 
</system.webServer>