foreach (string f in fileName) { if (list.Where(p => p.FileName.Trim().Equals(f.Trim(), StringComparison.OrdinalIgnoreCase)).Count() == 0) { Serve
Becasue you're adding the same instance each time, just overwriting its properties. You need
projectfile = new WhateverClassNameProjectFileIs();
at the top of your innermost foreach loop.
foreach