private bool ContainsReferencedAssembly(string directory, AssemblyDefinition referencedAssembly)
        {
            string assemblyName = Path.GetFileName(referencedAssembly.MainModule.FilePath);

#if !NET35
            IEnumerable <string> foundFiles = Directory.EnumerateFiles(directory, assemblyName, SearchOption.AllDirectories);
#else
            string[] foundFiles = Directory.GetFiles(directory, assemblyName, SearchOption.AllDirectories);
#endif
            foreach (string file in foundFiles)
            {
                ///Chech if all other assemblyName attributes match
                //AssemblyDefinition a = AssemblyDefinition.ReadAssembly(file);
                AssemblyDefinition a = currentAssemblyResolver.GetAssemblyDefinition(file);
                if (a.FullName == referencedAssembly.FullName)
                {
                    return(true);
                }
            }
            return(false);
        }