You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
causes any other Nuget Refs to be skipped in a project due to throwing an exception.
Fix (which worked for me) is to add an extra line of code to ensure vsReference.Path is not null or empty before checking to see if its value contains /packages.
private void LoadReferences()
{
References = new ExtendedObservableCollection<ReferenceModel>();
NuGetReferences = new ExtendedObservableCollection<ReferenceModel>();
foreach (var vsReference in _vsProject.References.OfType<Reference>())
{
var reference = new ReferenceModel(vsReference);
References.Add(reference);
if (!string.IsNullOrWhiteSpace(vsReference.Path)) // fix
{
if (vsReference.Path.ToLower().Contains("/packages/") || vsReference.Path.ToLower().Contains("\\packages\\"))
NuGetReferences.Add(reference);
}
}
}