There is a strange problem with some of my code. I've created a list of some objects; when trying to fill this list with the new objects, if I use F5, all the members of the list will be created exactly the same as each other!
But when I try to debug this problem by F11, then the members of the list will be created different from each other (which is correct). I'm using a loop to generate all members of the list, and in each iteration of the loop, I use new
to first instantiate the object of the class and then add it to the list.
I define the list as:
List<MyClass> classList = new List<MyClass>();
MyClass
contains some user defined members and methods
I could not figure out why F5 does not fill the list correctly. I tried to replicate the same problem with other classes that contain only string and integer members, but that works properly.