Resolve() public method

public Resolve ( ) : void
return void
        public NuGetAssemblyResolver(string projectLockFile)
        {
            var resolver = new NuGetPackageResolver
            {
                ProjectLockFile = projectLockFile,
            };
            resolver.Resolve();
            var references = resolver.ResolvedReferences;

            _references = new Dictionary<string, string>(references.Length, StringComparer.InvariantCultureIgnoreCase);
            foreach (var reference in references)
            {
                var fileName = Path.GetFileName(reference);
                string existingReference;
                if (_references.TryGetValue(fileName, out existingReference))
                    throw new Exception(string.Format("Reference \"{0}\" already added as \"{1}\".", reference, existingReference));
                _references.Add(fileName, reference);
            }
        }
Beispiel #2
0
        public NuGetAssemblyResolver(string projectLockFile)
        {
            var resolver = new NuGetPackageResolver
            {
                ProjectLockFile = projectLockFile,
            };

            resolver.Resolve();
            var references = resolver.ResolvedReferences;

            _references = new Dictionary <string, string>(references.Length, StringComparer.InvariantCultureIgnoreCase);
            foreach (var reference in references)
            {
                var    fileName = Path.GetFileName(reference);
                string existingReference;
                if (_references.TryGetValue(fileName, out existingReference))
                {
                    throw new Exception(string.Format("Reference \"{0}\" already added as \"{1}\".", reference, existingReference));
                }
                _references.Add(fileName, reference);
            }
        }