Example #1
0
        private int GetWarningLevel(VisualStudioProjectNode node)
        {
            var warningLevelNode = _projectNodeSelector.First(node, "WarningLevel");

            if (warningLevelNode == null)
            {
                return(4); // Default, node is not always present in .Net Standard project structure.
            }
            return(int.Parse(warningLevelNode.Value));
        }
        private Framework DetectFramework(VisualStudioSolutionProject project)
        {
            var frameworkVersionNode = _projectNodeSelector.First(project.Project, "TargetFrameworkVersion");
            var targetProfileNode    = _projectNodeSelector.First(project.Project, "TargetFrameworkProfile");

            if (frameworkVersionNode != null)
            {
                return(_stringToFrameworkConverter.Convert(frameworkVersionNode.Value, targetProfileNode?.Value));
            }

            _logger.Error($"TargetFrameworkVersion not found in project {project.Name}");
            return(Framework.Unknown);
        }
Example #3
0
        private string GetLanguageVersion(VisualStudioProjectNode node)
        {
            var languageVersion = _projectNodeSelector.First(node, "");

            if (languageVersion == null)
            {
                return("default");
            }

            return(languageVersion.Value);
        }
Example #4
0
        private string GetCodeAnalysisRuleSet(VisualStudioProjectNode node)
        {
            var codeAnalysisRuleset = _projectNodeSelector.First(node, "CodeAnalysisRuleSet");

            return(codeAnalysisRuleset?.Value);
        }