/// <inheritdoc/> public PlatformDetectorResult Detect(RepositoryContext context) { var detectionResult = _detector.Detect(new DetectorContext { SourceRepo = new Detector.LocalSourceRepo(context.SourceRepo.RootPath), }); if (detectionResult == null) { return(null); } var version = ResolveVersion(detectionResult.PlatformVersion); detectionResult.PlatformVersion = version; return(detectionResult); }
/// <inheritdoc/> public PlatformDetectorResult Detect(RepositoryContext context) { try { var detectionResult = _detector.Detect(new DetectorContext { SourceRepo = new Detector.LocalSourceRepo(context.SourceRepo.RootPath), }); if (detectionResult == null) { return(null); } ResolveVersions(context, detectionResult); return(detectionResult); } catch (InvalidProjectFileException e) { _logger.LogError(e, "Error occurred while trying to detect for .Net Core application(s)"); throw new InvalidUsageException(e.Message); } }