Beispiel #1
0
        string GetAssemblyFileNameFromHintPath(Microsoft.Build.Evaluation.Project p, Microsoft.Build.Evaluation.ProjectItem item)
        {
            string assemblyFileName = null;

            if (item.HasMetadata("HintPath"))
            {
                assemblyFileName = _fileSystem.Path.Combine(p.DirectoryPath, item.GetMetadataValue("HintPath")).ForceNativePathSeparator();
                _logger.Info("Looking for assembly from HintPath at " + assemblyFileName);
                if (!_fileSystem.File.Exists(assemblyFileName))
                {
                    _logger.Info("Did not find assembly from HintPath");
                    assemblyFileName = null;
                }
            }
            return(assemblyFileName);
        }
Beispiel #2
0
        public string GetReferenceHint(Microsoft.Build.Evaluation.ProjectItem p)
        {
            if (p.HasMetadata("HintPath") == false)
            {
                return("");
            }


            foreach (Microsoft.Build.Evaluation.ProjectMetadata m in p.Metadata)
            {
                if (m.Name == "HintPath")
                {
                    return(m.UnevaluatedValue);
                }
            }


            return("");
        }