I need to go through a big solution containing inaccessible projects . These inaccessible projects are unavailable because their paths no longer exist. If this solution was to keep these inaccessible links, is it possible to determine if every project that I run is accessible / inaccessible?
The following is a loop whose purpose is to determine whether each ProjectItem is saved in the current solution. But, since some projects are not available, I keep getting null references.
bool isDirty = false;
foreach (Project proj in sln.Projects)
{
if (proj == null)
continue;
foreach (ProjectItem pi in proj.ProjectItems)
{
if (pi == null)
continue;
if (!pi.Saved)
{
isDirty = true;
break;
}
}
}
source
share