I’m guessing that this post will be useful to a very small number of people if at all. However there might be a bigger lesson here for people writing their own collections and that is how not to code GetEnumerator method. but first some background information. when working with a visual studio add-in I needed find out weather a specific project is excluded from the build cycle. the DTE provide interfaces and object to access this info and the code I ended up with looked like this: 1: foreach (SolutionContext context in 2: ApplicationObject.Solution.SolutionBuild. 3: ActiveConfiguration.SolutionContexts) 4: { 5: if (context.ProjectName.Contains(project.Name)) 6: return !context.ShouldBuild; 7: }However, this code resulted...