Пример #1
0
        /// <summary>
        /// Verifies if the assembly provided is referenced by the source.
        /// </summary>
        /// <param name="assemblyName"> The assembly name. </param>
        /// <param name="source"> The source. </param>
        /// <returns> True if the assembly is referenced. </returns>
        public bool IsAssemblyReferenced(AssemblyName assemblyName, string source)
        {
            // This loads the dll in a different app domain. We can optimize this to load in the current domain since this code ould be run in a new app domain anyway.
            bool?utfReference = AssemblyHelper.DoesReferencesAssembly(source, assemblyName);

            // If no reference to UTF don't run discovery. Take conservative approach. If not able to find proceed with discovery.
            if (utfReference.HasValue && utfReference.Value == false)
            {
                return(false);
            }

            return(true);
        }