0

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

2 回答 2

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

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

于 2013-11-04T20:49:46.560 回答
0

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

<system.webServer>
<modules runAllManagedModulesForAllRequests="true"> 
</modules>
</system.webServer>
于 2016-07-10T09:58:20.483 回答