示例#1
0
        private bool IsAutoFrameworkDetectRequired(
            XPathNavigator navigator,
            out Framework chosenFramework)
        {
            bool required = true;

            chosenFramework = null;
            if (commandLineOptions.IsDesignMode)
            {
                bool isValidFx =
                    InferRunSettingsHelper.TryGetFrameworkXml(
                        navigator,
                        out var frameworkFromrunsettingsXml);
                required = !isValidFx || string.IsNullOrWhiteSpace(frameworkFromrunsettingsXml);
                if (!required)
                {
                    chosenFramework = Framework.FromString(frameworkFromrunsettingsXml);
                }
            }
            else if (!commandLineOptions.IsDesignMode &&
                     commandLineOptions.FrameworkVersionSpecified)
            {
                required        = false;
                chosenFramework = commandLineOptions.TargetFrameworkVersion;
            }

            return(required);
        }