Galin Iliev's blog

Software Architecture & Development

How is this possible?!?!

I am fighting with an interesting situation. I have code that when executed in VS2005 SP1 Web Application project gives one result and when same line executed in Immediate Window gives another result!?!?  Very weird.

thi code lives in anonymous method and it is called though delegate by

List<T>.FindAll(new Predicate<T>(filterDelegate));

Does anyone have an idea?

Comments (2) -

  • Angel Kafazov

    7/20/2007 9:30:57 AM | Reply

    Why not try putting the expression in parenthesis, might help.

    I have had similar issues in VS2005. The 'watch' window where I monitored variables used to show values different from those used at runtime. It seemed very weird to me, but turns up the IDE had some bugs. It happened in mixed code (native + managed), your might be another case.

  • Galcho

    7/26/2007 7:50:58 AM | Reply

    Angel, this is a good point but I am unable to try it as I changed the code a lot in order to optimize it and to achieve the desired goal Smile

    I remember tried parenthesis with different conditions but in that specific case I am not sure if I checked...

    anyway this would be good point for someone who has similar weird situation Smile