W
William Mild
I'm trying to update a session object in a web
application from within a thread. I need help fixing
this error.
ERROR: An unhandled exception of
type 'System.Runtime.Serialization.SerializationException'
occurred in Unknown Module.
Additional information: The type System.Web.HttpException
in Assembly System.Web, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not
marked as serializable.
CONFIGURATION: XP Professional SP1 running VS.NET 2003.
This is a Web application.
STEPS TO REPRODUCE:
Add web form to project and move to code behind. Paste
the following code:
Imports System.Threading
Public Class test
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim thisReportCard As New ReportCard2
Dim NewThread As Thread = New Thread(AddressOf
thisReportCard.IndividualSS)
NewThread.Start()
End Sub
End Class
Public Class ReportCard2
Inherits System.Web.UI.Page
Dim ThreadVar As String = "lock me"
Public Sub IndividualSS()
SyncLock (Me)
Session("PercentOfProgress") = 60
End SyncLock
End Sub
End Class
application from within a thread. I need help fixing
this error.
ERROR: An unhandled exception of
type 'System.Runtime.Serialization.SerializationException'
occurred in Unknown Module.
Additional information: The type System.Web.HttpException
in Assembly System.Web, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not
marked as serializable.
CONFIGURATION: XP Professional SP1 running VS.NET 2003.
This is a Web application.
STEPS TO REPRODUCE:
Add web form to project and move to code behind. Paste
the following code:
Imports System.Threading
Public Class test
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim thisReportCard As New ReportCard2
Dim NewThread As Thread = New Thread(AddressOf
thisReportCard.IndividualSS)
NewThread.Start()
End Sub
End Class
Public Class ReportCard2
Inherits System.Web.UI.Page
Dim ThreadVar As String = "lock me"
Public Sub IndividualSS()
SyncLock (Me)
Session("PercentOfProgress") = 60
End SyncLock
End Sub
End Class