That sounds like the session is storing a reference to the collection - but there's other code that also has a reference to the same collection, changing it via that reference.
I would track where references are obtained from the session, and examine those objects instead.
The reference the session hasn't changed - the object it points to has.
i.e. (pseudo-code)
theCollection = Session["theCollection"];
(later)
theCollection.Add(new Thing());
- The collection that the session refers to was only read once - and yet has been changed
________________________________
From: Discussion of building .NET applications targeted for the Web on behalf of Graeme Hood
Sent: Tue 05/08/2008 08:45
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] debugging - Break on value change?
It's actually a collection that is stored in the session at application
startup in global.asax and from then on only accessed from the session
variable. I see nowhere in the code that the session is written to after
global.asax, yet on a page load event after a sequence of events, the
collection has changed.
Guess I need to understand how session works more. Anyone got a good
explanatory link?
-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Chris Anderson
Sent: Monday, 04 August 2008 17:15
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] debugging - Break on value change?
Move access to the variable into a property get/set accessor (which will
actually result in your code reading better anyway)
Then put a breakpoint in the setter function (perhaps with a condition
on the new value being differernt to the current one)
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com