2013-11-04 38 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>