Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Server Error in Server Error in 'DNN4.8' Application.
Previous
 
Next
New Post
12/28/2007 3:55 PM
 

Fellows I don't know how you guys are getting around; but I finally figured out the issue with some help from one of the guru's on other forum and thought I should share my findings that fixed the issue, There are two things that need to be done, both are listed below (scroll to the bttom for second). Once these changes are done, hit your server again and everything starts to fly .

Apologies if I mislead and there is better way to fix the issue; but this seemed to be working consistently on 5 times consecutivfely; thought might help others.

1) Open the App_Code\Global.asax.vb and paste the following code [ This code has been pulled over from DNN 4.7 App_Code\Global.asax.vb ] between the lines

Between Lines -
----------------------------------------------------------------------
Public Class [Global]
    Inherits System.Web.HttpApplication

<<Paste the below code>>

#Region "Application Event Handlers"
----------------------------------------------------------------------

#Region "Private Methods"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' CheckVersion determines whether the App is synchronized with the DB
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    2/17/2005   created
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub CheckVersion()
            Dim Server As HttpServerUtility = HttpContext.Current.Server
            Dim Request As HttpRequest = HttpContext.Current.Request
            Dim Response As HttpResponse = HttpContext.Current.Response

            Dim AutoUpgrade As Boolean
            If Config.GetSetting("AutoUpgrade") Is Nothing Then
                AutoUpgrade = True
            Else
                AutoUpgrade = Boolean.Parse(Config.GetSetting("AutoUpgrade"))
            End If

            Dim UseWizard As Boolean
            If Config.GetSetting("UseInstallWizard") Is Nothing Then
                UseWizard = True
            Else
                UseWizard = Boolean.Parse(Config.GetSetting("UseInstallWizard"))
            End If

            'Determine the Upgrade status and redirect to Install.aspx
            Select Case GetUpgradeStatus()
                Case Globals.UpgradeStatus.Install
                    If AutoUpgrade Then
                        If UseWizard Then
                            Response.Redirect("~/Install/InstallWizard.aspx")
                        Else
                            Response.Redirect("~/Install/Install.aspx?mode=install")
                        End If
                    Else
                        CreateUnderConstructionPage()
                        Response.Redirect("~/Install/UnderConstruction.htm")
                    End If
                Case Globals.UpgradeStatus.Upgrade
                    If AutoUpgrade Then
                        Response.Redirect("~/Install/Install.aspx?mode=upgrade")
                    Else
                        CreateUnderConstructionPage()
                        Response.Redirect("~/Install/UnderConstruction.htm")
                    End If
                Case Globals.UpgradeStatus.Error
                    CreateUnderConstructionPage()
                    Response.Redirect("~/Install/UnderConstruction.htm")
            End Select
        End Sub

        Private Sub CreateUnderConstructionPage()
            ' create an UnderConstruction page if it does not exist already
            If Not File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/Install/UnderConstruction.htm")) Then
                If File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/Install/UnderConstruction.template.htm")) Then
                    File.Copy(System.Web.HttpContext.Current.Server.MapPath("~/Install/UnderConstruction.template.htm"), System.Web.HttpContext.Current.Server.MapPath("~/Install/UnderConstruction.htm"))
                End If
            End If
        End Sub

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' LogEnd logs the Application Start Event
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    1/28/2005   Moved back to App_End from Logging Module
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub LogEnd()
            Try
                Dim shutdownReason As System.Web.ApplicationShutdownReason = System.Web.Hosting.HostingEnvironment.ShutdownReason
                Dim shutdownDetail As String = ""
                Select Case shutdownReason
                    Case ApplicationShutdownReason.BinDirChangeOrDirectoryRename
                        shutdownDetail = "The AppDomain shut down because of a change to the Bin folder or files contained in it."
                    Case ApplicationShutdownReason.BrowsersDirChangeOrDirectoryRename
                        shutdownDetail = "The AppDomain shut down because of a change to the App_Browsers folder or files contained in it."
                    Case ApplicationShutdownReason.ChangeInGlobalAsax
                        shutdownDetail = "The AppDomain shut down because of a change to Global.asax."
                    Case ApplicationShutdownReason.ChangeInSecurityPolicyFile
                        shutdownDetail = "The AppDomain shut down because of a change in the code access security policy file."
                    Case ApplicationShutdownReason.CodeDirChangeOrDirectoryRename
                        shutdownDetail = "The AppDomain shut down because of a change to the App_Code folder or files contained in it."
                    Case ApplicationShutdownReason.ConfigurationChange
                        shutdownDetail = "The AppDomain shut down because of a change to the application level configuration."
                    Case ApplicationShutdownReason.HostingEnvironment
                        shutdownDetail = "The AppDomain shut down because of the hosting environment."
                    Case ApplicationShutdownReason.HttpRuntimeClose
                        shutdownDetail = "The AppDomain shut down because of a call to Close."
                    Case ApplicationShutdownReason.IdleTimeout
                        shutdownDetail = "The AppDomain shut down because of the maximum allowed idle time limit."
                    Case ApplicationShutdownReason.InitializationError
                        shutdownDetail = "The AppDomain shut down because of an AppDomain initialization error."
                    Case ApplicationShutdownReason.MaxRecompilationsReached
                        shutdownDetail = "The AppDomain shut down because of the maximum number of dynamic recompiles of resources limit."
                    Case ApplicationShutdownReason.PhysicalApplicationPathChanged
                        shutdownDetail = "The AppDomain shut down because of a change to the physical path for the application."
                    Case ApplicationShutdownReason.ResourcesDirChangeOrDirectoryRename
                        shutdownDetail = "The AppDomain shut down because of a change to the App_GlobalResources folder or files contained in it."
                    Case ApplicationShutdownReason.UnloadAppDomainCalled
                        shutdownDetail = "The AppDomain shut down because of a call to UnloadAppDomain."
                    Case Else
                        shutdownDetail = "No shutdown reason provided."
                End Select

                Dim objEv As New EventLogController
                Dim objEventLogInfo As New LogInfo
                objEventLogInfo.BypassBuffering = True
                objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.APPLICATION_SHUTTING_DOWN.ToString
                objEventLogInfo.AddProperty("Shutdown Details", shutdownDetail)

                objEv.AddLog(objEventLogInfo)
            Catch exc As Exception
                LogException(exc)
            End Try

            ' purge log buffer
            LoggingProvider.Instance.PurgeLogBuffer()
        End Sub

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' CacheMappedDirectory caches the Portal Mapped Directory(s)
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    1/27/2005   Moved back to App_Start from Caching Module
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub CacheMappedDirectory()
            'Cache the mapped physical home directory for each portal
            'so the mapped directories are available outside
            'of httpcontext.   This is especially necessary
            'when the /Portals or portal home directory has been
            'mapped in IIS to another directory or server.
            Dim objFolderController As New Services.FileSystem.FolderController
            Dim objPortalController As New PortalController
            Dim arrPortals As ArrayList = objPortalController.GetPortals()
            Dim i As Integer
            For i = 0 To arrPortals.Count - 1
                Dim objPortalInfo As PortalInfo = CType(arrPortals(i), PortalInfo)
                objFolderController.SetMappedDirectory(objPortalInfo, HttpContext.Current)
            Next

        End Sub

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' StopScheduler stops the Scheduler
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    1/28/2005   Moved back to App_End from Scheduling Module
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub StopScheduler()
            ' stop scheduled jobs
            Scheduling.SchedulingProvider.Instance.Halt("Stopped by Application_End")
        End Sub

#End Region

#Region "Public Methods"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' LogStart logs the Application Start Event
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    1/27/2005   Moved back to App_Start from Logging Module
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public Shared Sub LogStart()
            Dim objEv As New EventLogController
            Dim objEventLogInfo As New LogInfo
            objEventLogInfo.BypassBuffering = True
            objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.APPLICATION_START.ToString
            objEv.AddLog(objEventLogInfo)

        End Sub

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' StartScheduler starts the Scheduler
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''     [cnurse]    1/27/2005   Moved back to App_Start from Scheduling Module
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public Shared Sub StartScheduler()
            ' instantiate APPLICATION_START scheduled jobs
            If Services.Scheduling.SchedulingProvider.SchedulerMode = Scheduling.SchedulerMode.TIMER_METHOD Then
                Dim scheduler As Scheduling.SchedulingProvider = Scheduling.SchedulingProvider.Instance()
                scheduler.RunEventSchedule(Scheduling.EventName.APPLICATION_START)
                Dim newThread As New Threading.Thread(AddressOf Scheduling.SchedulingProvider.Instance.Start)
                newThread.IsBackground = True
                newThread.Start()
            End If
        End Sub

#End Region

2) In the same file change the application_start event handler code to as follows [ This has been taken from DNN4.7 App_Code\Global.asax.vb]

        Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            'global variable initialization
            Dim Server As HttpServerUtility = HttpContext.Current.Server
            If Config.GetSetting("ServerName") = "" Then
                ServerName = Server.MachineName
            Else
                ServerName = Config.GetSetting("ServerName")
            End If

            If HttpContext.Current.Request.ApplicationPath = "/" Then
                If Config.GetSetting("InstallationSubfolder") = "" Then
                    ApplicationPath = ""
                Else
                    ApplicationPath = Config.GetSetting("InstallationSubfolder") & "/"
                End If
            Else
                ApplicationPath = HttpContext.Current.Request.ApplicationPath
            End If
            ApplicationMapPath = System.AppDomain.CurrentDomain.BaseDirectory.Substring(0, System.AppDomain.CurrentDomain.BaseDirectory.Length - 1)
            ApplicationMapPath = ApplicationMapPath.Replace("/", "\")

            HostPath = ApplicationPath & "/Portals/_default/"
            HostMapPath = Server.MapPath(HostPath)

            'Don't process some of the AppStart methods if we are installing
            If Not HttpContext.Current.Request.Url.LocalPath.EndsWith("InstallWizard.aspx") Then
                'Check whether the current App Version is the same as the DB Version
                CheckVersion()

                'Cache Mapped Directory(s)
                CacheMappedDirectory()

                'Start Scheduler
                StartScheduler()
            End If

            'Try and Log the App Start and process the EventQueue (may fail if the database does not exist yet)
            Try
                'log APPLICATION_START event
                LogStart()

                'Process any messages in the EventQueue for the Application_Start event
                EventQueue.EventQueueController.ProcessMessages("Application_Start")
            Catch ex As Exception

            End Try

        End Sub


www.dotnetnuke.umaisa.com dnnsupport@dotnetnuke.umaisa.com - free DNN support - www.dotnetnuke.umaisa.com/dnnsupport
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Server Error in Server Error in 'DNN4.8' Application.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out