コード例 #1
0
        public bool TryParse(string input, out IVsNuGetFramework nuGetFramework)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            NuGetFramework framework = NuGetFramework.Parse(input);

            string targetFrameworkMoniker  = framework.DotNetFrameworkName;
            string targetPlatformMoniker   = framework.DotNetPlatformName;
            string targetPlatforMinVersion = null;

            nuGetFramework = new VsNuGetFramework(targetFrameworkMoniker, targetPlatformMoniker, targetPlatforMinVersion);
            return(framework.IsSpecificFramework);
        }
コード例 #2
0
        public bool TryParse(string input, out IVsNuGetFramework nuGetFramework)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            try
            {
                NuGetFramework framework = NuGetFramework.Parse(input);

                string targetFrameworkMoniker  = framework.DotNetFrameworkName;
                string targetPlatformMoniker   = framework.DotNetPlatformName;
                string targetPlatforMinVersion = null;

                nuGetFramework = new VsNuGetFramework(targetFrameworkMoniker, targetPlatformMoniker, targetPlatforMinVersion);
                return(framework.IsSpecificFramework);
            }
            catch (Exception exception)
            {
                _telemetryProvider.PostFault(exception, typeof(VsFrameworkParser).FullName);
                throw;
            }
        }