public string Resolve(string shortName)
 {
     return(AppDomain.CurrentDomain
            .GetAssemblies()
            .Where(a => StringComparer.OrdinalIgnoreCase.Equals(shortName, AssemblyLoaderExtensions.ExtractAssemblyShortName(a.FullName)))
            .Select(a => a.FullName)
            .SingleOrDefault());
 }
        public string Resolve(string shortName)
        {
            // A few common .net framework assemblies are referenced by the Tomelt.Framework assembly.
            // Look into those to see if we can find the assembly we are looking for.
            var tomeltFrameworkReferences = _cacheManager.Get(typeof(IAssemblyLoader), true, ctx =>
                                                              ctx.Key.Assembly
                                                              .GetReferencedAssemblies()
                                                              .GroupBy(n => AssemblyLoaderExtensions.ExtractAssemblyShortName(n.FullName), StringComparer.OrdinalIgnoreCase)
                                                              .ToDictionary(n => n.Key /*short assembly name*/, g => g.OrderBy(n => n.Version).Last() /* highest assembly version */, StringComparer.OrdinalIgnoreCase));

            AssemblyName assemblyName;

            if (tomeltFrameworkReferences.TryGetValue(shortName, out assemblyName))
            {
                return(assemblyName.FullName);
            }

            return(null);
        }
        public string Resolve(string shortName)
        {
            // Look in the GAC for commonly known .net frx assemblies
            // Note: We trim processor architecture to make things easier.
            // see http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx:
            // "Processor architecture is not required for strong names."
            var lookup = _cacheManager.Get("---", ctx =>
                                           GetGacListForDotNet40()
                                           .Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries)
                                           .Select(s => s.Trim())
                                           .Select(s => TrimProcessorArchitecture(s))
                                           .Where(s => !string.IsNullOrWhiteSpace(s))
                                           .Distinct(StringComparer.OrdinalIgnoreCase)
                                           .ToDictionary(s => AssemblyLoaderExtensions.ExtractAssemblyShortName(s), StringComparer.OrdinalIgnoreCase));

            string fullName;

            if (lookup.TryGetValue(shortName, out fullName))
            {
                return(fullName);
            }

            return(null);
        }