ASP.NET与GoDaddy.com上的global.asax一起发布

ASP.NET与GoDaddy.com上的global.asax一起发布,asp.net,global-asax,Asp.net,Global Asax,我正在使用Visual Studio 2012上载我的网站,但无法在我的域中显示该网站。一切都上传到GoDaddy ftp上。我和GoDaddy谈过,他们说是我的global.asax文件导致了这个问题。但他们不能告诉我到底是什么,因为他们不是代码专家。他验证了问题出在global.asax上,而不是web.config文件。我在下面提供了我的global.asax文件。任何帮助都会很棒,这样我就可以发布这个网站并在我的域名上工作。谢谢 Imports System.Web.Optimizati

我正在使用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

尝试添加一个空的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

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

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

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


您到底遇到了什么错误?找不到页面。就好像连我的代码都不读。但是GoDaddy确认那是我的global.asax文件。并确认服务器端运行正常。如果我用我的手机来查找该网站,那么我会发现页面未找到。502网关响应错误。不确定这是否有帮助,但这就是我得到的全部。它好像不存在。我从VS2010运行项目,我可以很好地上传,但2012似乎是它导致的问题。这是一个Web表单应用程序,对吗?假设您有一个default.aspx页面,如果键入,您会得到错误信息吗?错误是IIS错误或“应用程序中的服务器错误”?是,这是web窗体应用程序。我没有收到任何错误页面。通常,当我做一些导致错误的事情时,我会看到红色的错误页面,上面写着应用程序中的服务器错误,但这不是我得到的。当我输入domain.com/default.aspx时,我没有得到任何信息。这是我试图访问的实际站点,这就是我得到的:www.jenniferandjordan122813.com如果删除Global.asax文件,会发生什么?你犯了什么错误?如果您试图查看静态文件、图像或普通html文件,会发生什么情况?