Variables not initialized

  • Thread starter Thread starter Marc Fauser
  • Start date Start date
M

Marc Fauser

I have included a module in my ASP.Net project. The problem is, that only
every 4th or 5th start of the project the New() constructor is called. If I
use this
code in a normal VB.Net project, everything works fine. Any suggestions why
it only works every 5th time?

If New() is called, _GeneralPath is
"C:\Inetpub\wwwroot\E49-Franz\JDISPO49\WEBBDE.NET"
which is mapped to _ProgramPath in this example.

The next starts, I only have "E49-Franz" in _ProgramPath.
But I didn't change it.
After some starts, the New() constuctor is called again and
everything is ok.

Here is the code.

Namespace FAUSERAG.Parameters
Public Module Parameter
Public Class t_DBParameters
Public Class t_Path

Private _GeneralPath As String = ""
Private _ProgramPath As String = ""
Private _AddonPath As String = ""

Public Sub New()
_GeneralPath = HttpContext.Current.Server.MapPath("") &
"\"
_ProgramPath = _GeneralPath
_AddonPath = _GeneralPath & "images\"
End Sub
Public Property ProgramPath() As String
Get
Return _ProgramPath
End Get
Set(ByVal Value As String)
_ProgramPath = Value
End Set
End Property
Public Property GeneralPath() As String
Get
Return _GeneralPath
End Get
Set(ByVal Value As String)
_GeneralPath = Value
End Set
End Property
Public Property AddonPath() As String
Get
Return _AddonPath
End Get
Set(ByVal Value As String)
_AddonPath = Value
End Set
End Property

End Class
Public Path As t_Path = New t_Path
End Class
Public DBParameters As t_DBParameters = New t_DBParameters
End Module
End Namespace



Best regards,
Marc Fauser
 
Back
Top