Ejemplo n.º 1
0
        public AssemblyLink GetAssemblyLink(AssemblyNameReference assemblNamey, string parentName, string baseDirectory)
        {
            if (LinksLoaded.TryGetValue(assemblNamey.FullName, out var assemblyLink))
            {
                assemblyLink.Assembly?.ParentLinkName.Add(parentName);
                return(assemblyLink);
            }

            var(assembly, monoAssembly) = GetManaged(assemblNamey, baseDirectory);

            var newAssemblyLink = new AssemblyLink(assembly, assemblNamey.Version.ToString(), assemblNamey.FullName);

            LinksLoaded.Add(assemblNamey.FullName, newAssemblyLink);

            AddLoadedAssemblies(assembly, monoAssembly, assemblNamey.FullName, baseDirectory);
            newAssemblyLink.Assembly.ParentLinkName.Add(parentName);

            return(newAssemblyLink);
        }
        public AssemblyLink GetAssemblyLink(MetadataLoadContext context, AssemblyName assemblyName, string parentName, string baseDirectory)
        {
            if (LinksLoaded.TryGetValue(assemblyName.FullName, out var assemblyLink))
            {
                assemblyLink.Assembly?.ParentLinkName.Add(parentName);
                return(assemblyLink);
            }

            var(assembly, msAssembly) = GetManaged(context, assemblyName, baseDirectory);

            var newAssemblyLink = new AssemblyLink(assembly, assemblyName.Version?.ToString(), assemblyName.FullName);

            LinksLoaded.Add(assemblyName.FullName, newAssemblyLink);

            AddLoadedAssemblies(assembly, msAssembly, context, assemblyName.FullName, baseDirectory);

            newAssemblyLink.Assembly.ParentLinkName.Add(parentName);

            return(newAssemblyLink);
        }