Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parser Error

Status
Not open for further replies.

Erics44

Programmer
Oct 7, 2004
133
0
0
GB
Hi
I am having problems getting a web site up and running. This is the error I am getting, thanks for any help in advance.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'TheHouse.Global'.

Source Error:


Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="TheHouse.Global" %>



Source File: /global.asax Line: 1


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
 
Hi, is the same napespace (Its case sensitive) defined in the VB file of the global.asax page?

if yes, then try compiling the project once more and put the new dll in your server...

Known is handfull, Unknown is worldfull
 
Hi
Do you mean

Public Class Global?

Thanks for your reply
 
yup, the Global class...

Known is handfull, Unknown is worldfull
 
where would the namespace be defined?
 
Imports Casa.Global

Is this what you mean by the namespace being defined?

thanks for your help
 
nope

in your ASAX.VB file:

Namepace TheHouse
Class Global
...
End Class
end Namespace

Known is handfull, Unknown is worldfull
 
This is what my aspx.vb file currently looks like, how should it look?

Imports System.Web
Imports System.Web.SessionState

Public Class Global
Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Component Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

#End Region

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
End Sub

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
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 Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
End Sub

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

End Class

Thank you
 
Imports System.Web
Imports System.Web.SessionState


NameSpace TheHouse

Public Class Global
Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Component Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

#End Region

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
End Sub

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
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 Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
End Sub

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

End Class

End NameSpace



Known is handfull, Unknown is worldfull
 
Now I am getting

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'TheHouse.TheHouse.Global'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="TheHouse.TheHouse.Global" %>


 
change your ASCX file. you will not be able to do that in your VS.

open the file using notepad. and remove one of the TheHouse in TheHouse.TheHouse.Global...

Known is handfull, Unknown is worldfull
 
Is that the file that looks like this

<%@ Application Codebehind="Global.asax.vb" Inherits="TheHouse.Global" %>

I removed one of the TheHouse and I am back to the original error


thanks
 
did you compile the project once after you did the namespace change???

Known is handfull, Unknown is worldfull
 
By compile it do you mean build solution?
 
yes please...

Known is handfull, Unknown is worldfull
 
I have done that and I am now getting the error locally as well as on the net

I only get the error locally by changing the ASCX file
 
hmm,

i am blown. The error means that the ASAX file is unable to find a class called Global in a namespace called TheHouse.


lets try the reverse. Remove the namespace from the ASAX.VB file AND ASAX file

let it simply read just Global...

Known is handfull, Unknown is worldfull
 
when the asax file reads

<%@ Application Codebehind="Global.asax.vb" Inherits="Global" %>

and the asax.vb file reads just

(without the namespace)
Class Global

I get the error


Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Global" %>


 
and the error is the same (type cannot be found)? even after rebuilding the project???

Known is handfull, Unknown is worldfull
 
Yes

"could not load type"

I am thinking that perhaps there might be some difference between my version of vs I am using and the version that the hosting company are supporting perhaps?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top