Microsoft.VisualStudio.Project.AssemblyReferenceNode.ResolveAssemblyReference C# (CSharp) Method

ResolveAssemblyReference() private method

Does the actual job of resolving an assembly reference. We need a private method that does not violate calling virtual method from the constructor.
private ResolveAssemblyReference ( ) : void
return void
        private void ResolveAssemblyReference()
        {
            if (this.ProjectMgr == null || this.ProjectMgr.IsClosed)
            {
                return;
            }

            var group = this.ProjectMgr.CurrentConfig.GetItems(ProjectFileConstants.ReferencePath);
            foreach (var item in group)
            {
                string fullPath = this.GetFullPathFromPath(item.EvaluatedInclude);

                System.Reflection.AssemblyName name = System.Reflection.AssemblyName.GetAssemblyName(fullPath);

                // Try with full assembly name and then with weak assembly name.
                if (String.Equals(name.FullName, this.assemblyName.FullName, StringComparison.OrdinalIgnoreCase) || String.Equals(name.Name, this.assemblyName.Name, StringComparison.OrdinalIgnoreCase))
                {
                    if (!NativeMethods.IsSamePath(fullPath, this.assemblyPath))
                    {
                        // set the full path now.
                        this.assemblyPath = fullPath;

                        // We have a new item to listen too, since the assembly reference is resolved from a different place.
                        this.fileChangeListener.ObserveItem(this.assemblyPath);
                    }

                    this.resolvedAssemblyName = name;

                    // No hint path is needed since the assembly path will always be resolved.
                    return;
                }
            }
        }