Пример #1
0
        /// <summary>
        /// Find related files like .pdbs and .xmls
        /// </summary>
        /// <param name="fullPath">Path to the parent assembly.</param>
        /// <param name="reference">The reference to the parent assembly.</param>
        private void FindRelatedFiles
        (
            Reference reference
        )
        {
            string baseName = reference.FullPathWithoutExtension;

            // Look for companion files like pdbs and xmls that ride along with 
            // assemblies.
            foreach (string companionExtension in _relatedFileExtensions)
            {
                string companionFile = baseName + companionExtension;

                if (_fileExists(companionFile))
                {
                    reference.AddRelatedFileExtension(companionExtension);
                }
            }

            // Native Winmd files may have a companion dll beside it.
            // If this is not a primary reference or the implementation metadata is not set on the item we need to set the implmentation metadata.
            if (reference.IsWinMDFile && (!reference.IsPrimary || String.IsNullOrEmpty(reference.PrimarySourceItem.GetMetadata(ItemMetadataNames.winmdImplmentationFile))) && !reference.IsManagedWinMDFile)
            {
                string companionFile = baseName + ".dll";

                if (_fileExists(companionFile))
                {
                    reference.ImplementationAssembly = companionFile;
                }
            }
        }
 private void FindRelatedFiles(Reference reference)
 {
     string fullPathWithoutExtension = reference.FullPathWithoutExtension;
     foreach (string str2 in this.relatedFileExtensions)
     {
         string path = fullPathWithoutExtension + str2;
         if (this.fileExists(path))
         {
             reference.AddRelatedFileExtension(str2);
         }
     }
 }