Esempio n. 1
0
        public void AddArtefact(string name, byte[] relatedFile)
        {
            BuildArtifact dllInfo = BuildArtifact.Get(relatedFile);

            dllInfo.FileName = name;
            if (!dllInfo.IsAssembly)
            {
                dllInfo.Name = name;
            }
            Artefacts.Add(dllInfo);
        }
Esempio n. 2
0
        public static BuildArtifact Get(byte[] data)
        {
            BuildArtifact art = new BuildArtifact();
            using (MemoryStream ms = new MemoryStream(data))
            {
                try
                {
                    Mono.Cecil.AssemblyDefinition def = Mono.Cecil.AssemblyDefinition.ReadAssembly(ms);
                    Mono.Cecil.AssemblyNameReference defn = Mono.Cecil.AssemblyNameDefinition.Parse(def.FullName);

                    art.Version = defn.Version.ToString();
                    art.Name = defn.Name;
                    art.IsAssembly = true;
                }
                catch
                {

                }
            }

            art.Data = data;

            return art;
        }
Esempio n. 3
0
        public static BuildArtifact Get(byte[] data)
        {
            BuildArtifact art = new BuildArtifact();

            using (MemoryStream ms = new MemoryStream(data))
            {
                try
                {
                    Mono.Cecil.AssemblyDefinition    def  = Mono.Cecil.AssemblyDefinition.ReadAssembly(ms);
                    Mono.Cecil.AssemblyNameReference defn = Mono.Cecil.AssemblyNameDefinition.Parse(def.FullName);

                    art.Version    = defn.Version.ToString();
                    art.Name       = defn.Name;
                    art.IsAssembly = true;
                }
                catch
                {
                }
            }

            art.Data = data;

            return(art);
        }