All,
Does anyone know what could cause "Attempted to Access an Unloaded AppDomain" errors? I'm beginning to see these in the windows event log. Basically I have some long running executables which are started in new threads. But they seems to just die and looking into things I'm seeing these errors about the est time of death.
Here is the new thread code:
This thread calls an executable and has the potential to run for hours. For months things have been working but all of a sudden the process never completes and in the web servers event log I am starting to see Attempted to Access an Unloaded AppDomain errors.
Anyone have any experience with this type of error? Also these errors only seem to happen overnights. Processing during the day is not a problem.
Here is the call to the exe:
* Sine scientia ars nihil est
* Respondeat superior
Does anyone know what could cause "Attempted to Access an Unloaded AppDomain" errors? I'm beginning to see these in the windows event log. Basically I have some long running executables which are started in new threads. But they seems to just die and looking into things I'm seeing these errors about the est time of death.
Here is the new thread code:
Code:
<WebMethod()> Public Function RunCostProcesses(ByVal DatabaseId As String, ByVal StartDate As Date, ByVal EndDate As Date) As String
Dim clsTest As New RunProcesses(DatabaseId, StartDate2, EndDate2)
Dim newThread As Thread = New Thread(New ParameterizedThreadStart(AddressOf RunCostProcesses))
newThread.Start(clsTest)
Return String.Empty
End Function
Private Sub RunCostProcesses(ByVal obj As Object)
Dim clsTest As RunProcesses = CType(obj, RunProcesses)
clsTest.Start()
End Sub
This thread calls an executable and has the potential to run for hours. For months things have been working but all of a sudden the process never completes and in the web servers event log I am starting to see Attempted to Access an Unloaded AppDomain errors.
Anyone have any experience with this type of error? Also these errors only seem to happen overnights. Processing during the day is not a problem.
Here is the call to the exe:
Code:
Private Sub RunPhase2()
Dim psi As System.Diagnostics.ProcessStartInfo
Dim processPath As String
processPath = String.Format(Me.ProcessPath, "Phase2.exe")
Dim arguments As New StringBuilder
arguments.AppendFormat(" {0} {1} {2} ", Me.DbId, Me.StartDate2.ToString("MM/dd/yyyy"), Me.EndDate2.ToString("MM/dd/yyyy"))
psi = New System.Diagnostics.ProcessStartInfo()
psi.FileName = processPath
psi.Arguments = arguments.ToString
psi.UseShellExecute = False
psi.CreateNoWindow = True
psi.WorkingDirectory = Me.WorkingDir
Dim proc As New System.Diagnostics.Process
proc = System.Diagnostics.Process.Start(psi)
proc.WaitForExit()
proc.Close()
End Sub
* Sine scientia ars nihil est
* Respondeat superior