ASP.NET在GoDaddy.com上的global.asax问题

时间:2013-11-04 19:12:48

标签: asp.net global-asax

我正在使用Visual Studio 2012上传我的网站,但无法将其显示在我的域中。一切都在GoDaddy ftp上传。我和GoDaddy谈过,他们说我的global.asax文件导致了这个问题。但他们无法确切地告诉我究竟是什么,因为他们不是代码方面的专家。他验证了global.asax是问题,而不是web.config文件。我在下面提供了我的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

2 个答案:

答案 0 :(得分: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

下一步是逐个取消注释,然后检测导致错误的那个。

答案 1 :(得分:0)

将以下行添加到web.config文件

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