2
Vote

GetProjectReferencesContainingThisProject() does not support projects with no References container

description

If a ProjectNode overrides CreateReferenceContainerNode() to return null, to achieve a "references-less" project (a la Code Sharing Project), the GetProjectReferencesContainingThisProject() method of the SolutionListenerForProjectReferenceUpdate class throws an Assert().

This is incorrect.

The method should instead test for a non-null referenceContainer and proceed accordingly, thus:
                        IReferenceContainer referenceContainer = provider.GetReferenceContainer();

                        // It is valid for a project not to have a References folder

                        if (referenceContainer != null)
                        {
                            ProjectReferenceNode projectReferenceNode = GetProjectReferenceOnNodeForHierarchy(referenceContainer.EnumReferences(), inputHierarchy);
                            if (projectReferenceNode != null)
                            {
                                projectReferences.Add(projectReferenceNode);
                            }
                        }

comments