523 instantiations of Version
Aspire.Cli.Tests (17)
Utils\ContainerRuntimeCheckTests.cs (17)
19Assert.Equal(new Version(28, 0, 4), clientVersion); 21Assert.Equal(new Version(28, 0, 4), serverVersion); 35Assert.Equal(new Version(28, 5, 1), clientVersion); 37Assert.Equal(new Version(28, 5, 1), serverVersion); 51Assert.Equal(new Version(29, 1, 3), clientVersion); 53Assert.Equal(new Version(29, 1, 3), serverVersion); 67Assert.Equal(new Version(4, 9, 3), clientVersion); 82Assert.Equal(new Version(29, 1, 3), clientVersion); 96Assert.Equal(new Version(19, 3, 15), clientVersion); 110Assert.Equal(new Version(20, 10), clientVersion); 143Assert.Equal(new Version(1, 0, 0), serverVersion); 183Assert.Equal(new Version(28, 0, 4), clientVersion); 185Assert.Equal(new Version(27, 5, 1), serverVersion); 199Assert.Equal(new Version(28, 0, 4), clientVersion); 201Assert.Equal(new Version(28, 0, 4), serverVersion); 256Assert.Equal(new Version(27, 5, 1), result); 271Assert.Equal(new Version(4, 3, 1), result);
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\ConfluentKafkaCommon.cs (1)
19internal static readonly string InstrumentationVersion = new Version(0, 1, 0, 0).ToString();
Aspire.Hosting (2)
Dcp\DcpVersion.cs (2)
8public static Version MinimumVersionInclusive = new Version(0, 21, 1); // Aspire 13.2 release 13public static Version Dev = new Version(1000, 0, 0);
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
19public static readonly Version MinimumSupportedVersion = new(1, 0, 1435);
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (4)
AspireEFMySqlExtensionsTests.cs (3)
22private static readonly MySqlServerVersion s_serverVersion = new(new Version(MySqlContainerImageTags.Tag)); 196optionsBuilder.UseMySql(new MySqlServerVersion(new Version(8, 2, 0))), 232optionsBuilder.UseMySql(new MySqlServerVersion(new Version(8, 2, 0)), mySqlBuilder =>
EnrichMySqlTests.cs (1)
23public static readonly MySqlServerVersion DefaultVersion = new(new Version(MySqlContainerImageTags.Tag));
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
23internal static readonly Version Version = new Version(1, 0, 0, 13);
dotnet (8)
CommandFactory\CommandResolution\PackagedCommandSpecFactoryWithCliRuntime.cs (1)
62return new Version(version);
CommandFactory\CommandResolution\ProjectToolsCommandResolver.cs (1)
124project.DotnetCliToolTargetFramework.Version >= new Version(2, 0, 0))
Commands\New\BuiltInTemplatePackageProvider.cs (1)
97var majorMinorDirVersion = new Version(dirInfo.Value.Major, dirInfo.Value.Minor);
Commands\Workload\WorkloadUtilities.cs (2)
23var firstVersion = new Version(first.Substring(0, firstDash)); 24var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Common\EnvironmentVariableNames.cs (1)
61private static readonly Version s_version6_0 = new(6, 0);
ToolPackage\ToolPackageDownloader.cs (1)
180currentTargetFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
ToolPackage\ToolPackageInstance.cs (1)
193var currentFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
dotnet-svcutil-lib (7)
AppSettings.cs (1)
17if (!frameworkInfo.IsDnx || frameworkInfo.Version >= new Version("2.0"))
Bootstrapper\SvcutilBootstrapper.cs (1)
127if (isSupportedTFM && frameworkInfo.Name != FrameworkInfo.Netstandard && frameworkInfo.Version.CompareTo(new Version(6, 0)) >= 0)
Shared\FrameworkInfo.cs (1)
73version = new Version(versionString);
Shared\TargetFrameworkHelper.cs (4)
17public static Version MinSupportedNetFxVersionForDotNet { get; } = new Version("4.5"); 18public static Version MinSupportedNetStandardVersion { get; } = new Version("1.3"); 19public static Version MinSupportedNetCoreAppVersion { get; } = new Version("1.0"); 155&& frameworkInfo.Version < new Version(s_currentSupportedVersions.First());
GenerateDocumentationAndConfigFiles (2)
Program.cs (1)
981var unshippedVersion = new Version(maxShippedVersion!.Major + 1, maxShippedVersion.Minor);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
42internal static Version UnshippedVersion { get; } = new Version(int.MaxValue, int.MaxValue);
ILAssembler (4)
EntityRegistry.cs (3)
381asmRef.Version ?? new Version(), 399Assembly.Version ?? new Version(), 575?? GetOrCreateAssemblyReference("mscorlib", new Version(4, 0), culture: null, publicKeyOrToken: null, 0, ProcessorArchitecture.None);
GrammarVisitor.cs (1)
575_currentAssemblyOrRef!.Version = new Version(
ILCompiler.Build.Tasks (1)
ComputeManagedAssembliesToCompileToNative.cs (1)
161return new Version(versionInfo.FileMajorPart, versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);
ILCompiler.Compiler (5)
Compiler\Dataflow\CompilerGeneratedState.cs (1)
690generatedType.Module.Assembly is EcmaAssembly asm && asm.GetTargetFrameworkVersion() >= new Version(10, 0))
Compiler\MstatObjectDumper.cs (1)
49version: new Version(VersionMajor, VersionMinor));
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (3)
46_metadataBuilder.AddAssembly(assemblyNameHandle, assemblyName.Version ?? new Version(0, 0, 0, 0), default(StringHandle), publicKey: publicKeyArray != null ? _metadataBuilder.GetOrAddBlob(publicKeyArray) : default(BlobHandle), flags, AssemblyHashAlgorithm.None); 60var canonAssemblyRef = _metadataBuilder.AddAssemblyReference(canonAssemblyNameHandle, new Version(0, 0, 0, 0), default(StringHandle), default(BlobHandle), (AssemblyFlags)0, default(BlobHandle)); 142Version version = name.Version ?? new Version(0, 0);
ILCompiler.Diagnostics (1)
PdbWriter.cs (1)
446compilerVersion = new Version(versionString);
ILCompiler.ReadyToRun (4)
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (1)
96Version manifestAssemblyVersion = new Version(0, 0, 0, 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (3)
46_metadataBuilder.AddAssembly(assemblyNameHandle, assemblyName.Version ?? new Version(0, 0, 0, 0), default(StringHandle), publicKey: publicKeyArray != null ? _metadataBuilder.GetOrAddBlob(publicKeyArray) : default(BlobHandle), flags, AssemblyHashAlgorithm.None); 60var canonAssemblyRef = _metadataBuilder.AddAssemblyReference(canonAssemblyNameHandle, new Version(0, 0, 0, 0), default(StringHandle), default(BlobHandle), (AssemblyFlags)0, default(BlobHandle)); 142Version version = name.Version ?? new Version(0, 0);
illink (2)
ILLink.RoslynAnalyzer (3)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (3)
283versionNumbers[2] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1]) : 284versionNumbers[3] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2]) : 285new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]);
installer.tasks (2)
FileUtilities.cs (1)
24return new Version(fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
GenerateFileVersionProps.cs (1)
17private static readonly Version ZeroVersion = new Version(0, 0, 0, 0);
Microsoft.AspNetCore.Server.IISIntegration (1)
WebHostBuilderIISExtensions.cs (1)
51isWebSocketsSupported = (Environment.OSVersion.Version >= new Version(6, 2));
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Middleware\HttpsConnectionMiddleware.cs (2)
553if (Environment.OSVersion.Version < new Version(6, 3) // Missing ALPN support 555|| (Environment.OSVersion.Version < new Version(10, 0) && !enableHttp2OnWindows81))
Microsoft.Build (3)
Definition\ProjectCollection.cs (1)
496s_engineVersion = new Version(versionInfo.FileMajorPart, versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);
Definition\Toolset.cs (1)
700Version visualStudioVersionFromSolutionAsVersion = new Version(visualStudioVersionFromSolution, 0);
Utilities\Utilities.cs (1)
377if (toolsVersionAsVersion > new Version(15, 0))
Microsoft.Build.Framework (41)
BackEnd\Handshake.cs (1)
124var fileVersion = new Version(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion!);
BackEnd\TranslatorHelpers.cs (3)
348version = new Version(major, minor); 352version = new Version(major, minor, build); 356version = new Version(major, minor, build, revision);
BuildEnvironmentHelper.cs (1)
292Version v = new Version(CurrentVisualStudioVersion);
ChangeWaves.cs (10)
30internal static readonly Version Wave17_10 = new Version(17, 10); 31internal static readonly Version Wave17_12 = new Version(17, 12); 32internal static readonly Version Wave17_14 = new Version(17, 14); 33internal static readonly Version Wave18_3 = new Version(18, 3); 34internal static readonly Version Wave18_4 = new Version(18, 4); 35internal static readonly Version Wave18_5 = new Version(18, 5); 36internal static readonly Version Wave18_6 = new Version(18, 6); 37internal static readonly Version Wave18_7 = new Version(18, 7); 38internal static readonly Version Wave18_8 = new Version(18, 8); 44internal static readonly Version EnableAllFeatures = new Version(999, 999);
Loader\CoreCLRAssemblyLoader.cs (1)
31private static readonly Version _currentAssemblyVersion = new Version(Microsoft.Build.Shared.MSBuildConstants.CurrentAssemblyVersion);
Loader\LoadedType.cs (1)
196Version lastVersionToForce = new Version(3, 5);
Utilities\FrameworkLocationHelper.cs (24)
53internal static readonly Version dotNetFrameworkVersion11 = new Version(1, 1); 54internal static readonly Version dotNetFrameworkVersion20 = new Version(2, 0); 55internal static readonly Version dotNetFrameworkVersion30 = new Version(3, 0); 56internal static readonly Version dotNetFrameworkVersion35 = new Version(3, 5); 57internal static readonly Version dotNetFrameworkVersion40 = new Version(4, 0); 58internal static readonly Version dotNetFrameworkVersion45 = new Version(4, 5); 59internal static readonly Version dotNetFrameworkVersion451 = new Version(4, 5, 1); 60internal static readonly Version dotNetFrameworkVersion452 = new Version(4, 5, 2); 61internal static readonly Version dotNetFrameworkVersion46 = new Version(4, 6); 62internal static readonly Version dotNetFrameworkVersion461 = new Version(4, 6, 1); 63internal static readonly Version dotNetFrameworkVersion462 = new Version(4, 6, 2); 64internal static readonly Version dotNetFrameworkVersion47 = new Version(4, 7); 65internal static readonly Version dotNetFrameworkVersion471 = new Version(4, 7, 1); 66internal static readonly Version dotNetFrameworkVersion472 = new Version(4, 7, 2); 67internal static readonly Version dotNetFrameworkVersion48 = new Version(4, 8); 68internal static readonly Version dotNetFrameworkVersion481 = new Version(4, 8, 1); 71internal static readonly Version visualStudioVersion100 = new Version(10, 0); 72internal static readonly Version visualStudioVersion110 = new Version(11, 0); 73internal static readonly Version visualStudioVersion120 = new Version(12, 0); 74internal static readonly Version visualStudioVersion140 = new Version(14, 0); 75internal static readonly Version visualStudioVersion150 = new Version(15, 0); 76internal static readonly Version visualStudioVersion160 = new Version(16, 0); 77internal static readonly Version visualStudioVersion170 = new Version(17, 0); 78internal static readonly Version visualStudioVersion180 = new Version(18, 0);
Microsoft.Build.Tasks.Core (32)
AppConfig\BindingRedirect.cs (2)
61OldVersionLow = OldVersionHigh = new Version(oldVersion); 76NewVersion = new Version(newVersionAttribute);
AssemblyDependency\AssemblyNameReferenceAscendingVersionComparer.cs (1)
17private static Version DummyVersion { get; } = new Version(0, 0);
AssemblyDependency\GenerateBindingRedirects.cs (1)
289var maxVersion = new Version(maxVerStr);
AssemblyDependency\ReferenceTable.cs (2)
30private static readonly Version s_targetFrameworkVersion_40 = new Version("4.0"); 1957var zeroVersion = new Version(0, 0, 0, 0);
AssemblyDependency\ResolveAssemblyReference.cs (1)
2939versionToReturn = new Version(2, 0, 50727);
LC.cs (2)
196if (targetFramework.CompareTo(new Version("4.6")) < 0) 214if (targetFramework.CompareTo(new Version("4.6")) >= 0)
ManifestUtil\ApplicationManifest.cs (2)
288v = new Version($"{_oSMajor}.{_oSMinor}.{_oSBuild}.{_oSRevision}"); 307Version v = new Version(value);
ManifestUtil\ComImporter.cs (1)
69TypeLib = new TypeLib(tlbid, new Version(typeLibAttr.wMajorVerNum, typeLibAttr.wMinorVerNum), helpdir, typeLibAttr.lcid, Convert.ToInt32(typeLibAttr.wLibFlags, CultureInfo.InvariantCulture));
ManifestUtil\Constants.cs (1)
15public static readonly Version EntryPointMinimumImageVersion = new Version("2.0.0.0");
ManifestUtil\DeployManifest.cs (4)
265var ver = new Version(version); 266var result = new Version(ver.Major, ver.Minor, ver.Build); 611var v1 = new Version(_minimumRequiredVersion); 612var v2 = new Version(AssemblyIdentity.Version);
ManifestUtil\SecurityUtil.cs (1)
72private static readonly Version s_dotNet45Version = new Version("4.5");
ManifestUtil\Util.cs (6)
120v = new Version(s_clrVersion4[0], s_clrVersion4[1], s_clrVersion4[2], s_clrVersion4[3]); 143Version currentVersion = new Version(s_clrVersion4[0], s_clrVersion4[1], s_clrVersion4[2], s_clrVersion4[3]); 152clrVersion = new Version(currentVersion.Major, currentVersion.Minor, currentVersion.Build, 0); 158clrVersion = new Version(s_clrVersion4[0], s_clrVersion4[1], s_clrVersion4[2], s_clrVersion4[3]); 331version = new Version(value); 628return new Version(version);
NativeMethods.cs (1)
533name.Version = new Version(match.Groups[1].Value);
RequiresFramework35SP1Assembly.cs (1)
90return new Version(version);
ResolveManifestFiles.cs (1)
238return new Version(version);
ResolveSDKReference.cs (1)
81private static readonly Version s_defaultTargetPlatformVersion = new Version("7.0");
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (3)
392replacementVersion = new Version(candidateVersion.Major, candidateVersion.Minor); 397replacementVersion = new Version(candidateVersion.Major, candidateVersion.Minor, candidateVersion.Build); 446versionStrings.Add(new ExtensionFoldersRegistryKey(key, targetVersion ?? new Version(0, 0)));
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (1)
90return new Version(candidateVersion.Major, candidateVersion.Minor);
Microsoft.Build.Utilities.Core (7)
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (3)
392replacementVersion = new Version(candidateVersion.Major, candidateVersion.Minor); 397replacementVersion = new Version(candidateVersion.Major, candidateVersion.Minor, candidateVersion.Build); 446versionStrings.Add(new ExtensionFoldersRegistryKey(key, targetVersion ?? new Version(0, 0)));
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (1)
90return new Version(candidateVersion.Major, candidateVersion.Minor);
ToolLocationHelper.cs (3)
1382IEnumerable<string> platformMonikerList = GetPlatformsForSDK(sdkIdentifier, new Version(sdkVersion), sdkRoots, null); 2483extensionSdk = new TargetPlatformSDK(string.Empty, new Version(0, 0), null); 3756return new Version(targetFrameworkVersion);
Microsoft.CodeAnalysis (8)
CommandLine\CommonCompiler.cs (1)
728Version assemblyVersion = GetAssemblyVersion() ?? new Version();
Desktop\AssemblyVersion.cs (1)
114return new Version(version.Major, version.Minor, version.Build, version.Revision);
Desktop\DesktopAssemblyIdentityComparer.cs (1)
276newVersion = new Version(10, 0, 0, 0);
MetadataReference\AssemblyIdentity.cs (1)
247internal static readonly Version NullVersion = new Version(0, 0, 0, 0);
MetadataReference\AssemblyIdentity.DisplayName.cs (1)
585return new Version(
VersionHelper.cs (3)
146version = new Version(values[0], values[1], values[2], values[3]); 195return new Version(pattern.Major, pattern.Minor, (ushort)build, (ushort)revision); 199return new Version(pattern.Major, pattern.Minor, pattern.Build, (ushort)revision);
Microsoft.CodeAnalysis.Analyzers (1)
MetaAnalyzers\ReleaseTrackingHelper.cs (1)
42internal static Version UnshippedVersion { get; } = new Version(int.MaxValue, int.MaxValue);
Microsoft.CodeAnalysis.Razor.Compiler (1)
Mvc\ViewComponentTypes.cs (1)
14public static readonly Version AssemblyVersion = new Version(1, 1, 0, 0);
Microsoft.CodeAnalysis.Scripting (2)
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (2)
219return new Version((int)(hi >> 16), (int)(hi & 0xffff), (int)(lo >> 16), (int)(lo & 0xffff)); 251return new Version((int)(major ?? 0), (int)(minor ?? 0), (int)(build ?? 0), (int)(revision ?? 0));
Microsoft.CodeAnalysis.Workspaces (1)
Utilities\Versions.cs (1)
11public static readonly Version Null = new(0, 0, 0, 0);
Microsoft.DiaSymReader (1)
Extensions\SymUnmanagedExtensions.Reader.cs (1)
199version = new Version(major, minor, build, revision);
Microsoft.DotNet.Build.Tasks.Packaging (14)
ApplyBaseLine.cs (1)
69versions.Add(new Version(baseLinePackage.GetMetadata("Version")));
ApplyPreReleaseSuffix.cs (2)
166Version result = new Version(versionString); 169result = new Version(result.Major, result.Minor, result.Build);
FrameworkUtilities.cs (3)
46return new Version(0, 0, 0, 0); 55return Ensure4PartVersion(new Version(versionString)); 62version = new Version(version.Major,
GetPackageVersion.cs (1)
37.Select(f => new Version(f.GetMetadata("AssemblyVersion")));
NuGetUtility.cs (1)
86return versions.Where(v => VersionUtility.As2PartVersion(v) == new Version(eraMajorVersion, eraMinorVersion))
PackageIndex.cs (2)
221Version supportedVersion = (versionAttribute != null) ? new Version(versionAttribute.Value) : VersionUtility.MaxVersion; 709var version = versionString.Equals(AnyVersion, StringComparison.OrdinalIgnoreCase) ? VersionUtility.MaxVersion : new Version(versionString);
VersionUtility.cs (4)
13public static readonly Version MaxVersion = new Version(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue); 75return new Version(version.Major, version.Minor, build); 88return new Version(version.Major, version.Minor); 115return new Version(version.Major, version.Minor, build, revision);
Microsoft.DotNet.Build.Tasks.Workloads (4)
Swix\SwixComponent.cs (3)
28private static readonly Version s_v1 = new Version("1.0.0.0"); 163new Version(resourceItem.GetMetadata(Metadata.Version)) : 164new Version((new ReleaseVersion(manifest.Version)).ToString(3));
WorkloadPackageBase.cs (1)
326return new(package.GetMetadata(Metadata.MsiVersion));
Microsoft.DotNet.HotReload.Watch (3)
Utilities\Versions.cs (3)
8public static readonly Version Version3_1 = new(3, 1); 9public static readonly Version Version6_0 = new(6, 0); 10public static readonly Version Version11_0 = new(11, 0);
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
143return new Version(15, 3, 0);
Microsoft.DotNet.SharedFramework.Sdk (2)
src\FileUtilities.cs (1)
26return new Version(fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
src\ValidateFileVersions.cs (1)
15private static readonly Version ZeroVersion = new Version(0, 0, 0, 0);
Microsoft.DotNet.TemplateLocator (4)
src\sdk\src\Common\EnvironmentVariableNames.cs (1)
61private static readonly Version s_version6_0 = new(6, 0);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
TemplateLocator.cs (1)
76var msbuildMajorMinorVersion = new Version(parsedVsVersion.Major, parsedVsVersion.Minor, 0);
Microsoft.Extensions.AI.Abstractions.Tests (1)
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
100yield return new TestData<Version>(new(1, 2, 3, 4), """{"$comment":"Represents a version string.", "type":["string","null"],"pattern":"^\\d+(\\.\\d+){1,3}$"}""");
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\RequestMessageSnapshotTests.cs (1)
59Version = new Version(1, 1),
Microsoft.Extensions.Identity.Core (4)
IdentitySchemaVersions.cs (4)
16public static readonly Version Default = new Version(0, 0); 21public static readonly Version Version1 = new Version(1, 0); 26public static readonly Version Version2 = new Version(2, 0); 31public static readonly Version Version3 = new Version(3, 0);
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
94P4 = new Version(1, 2, 3, 4),
Microsoft.Maui.Essentials (2)
Types\Shared\Utils.shared.cs (2)
16 return new Version(major, 0); 18 return new Version(0, 0);
Microsoft.ML.TestFramework (4)
Attributes\OnnxTheoryAttribute.cs (1)
24|| AttributeHelpers.CheckLibcVersionGreaterThanMinimum(new Version(2, 23)))
Attributes\TensorflowFactAttribute.cs (1)
25AttributeHelpers.CheckLibcVersionGreaterThanMinimum(new Version(2, 23))))
Attributes\TensorflowTheoryAttribute.cs (1)
25AttributeHelpers.CheckLibcVersionGreaterThanMinimum(new Version(2, 23))))
Attributes\TorchSharpFactAttribute.cs (1)
30AttributeHelpers.CheckLibcVersionGreaterThanMinimum(new Version(2, 23))));
Microsoft.ML.TestFrameworkCommon (1)
Attributes\OnnxFactAttribute.cs (1)
29|| AttributeHelpers.CheckLibcVersionGreaterThanMinimum(new Version(2, 23)))
Microsoft.NET.Build.Tasks (23)
CreateWindowsSdkKnownFrameworkReferences.cs (5)
62var tpv = new Version(TargetPlatformVersion); 70var normalizedTargetFrameworkVersion = ProcessFrameworkReferences.NormalizeVersion(new Version(TargetFrameworkVersion)); 81Version normalizedMinimumVersion = new(0, 0, 0); 84normalizedMinimumVersion = ProcessFrameworkReferences.NormalizeVersion(new Version(minimumNETVersion)); 107windowsSdkPackageVersionParsed = new Version(windowsSdkPackageVersionParsed.Major, windowsSdkPackageVersionParsed.Minor, windowsSdkPackageVersionParsed.Build, minimumWindowsSdkRevision);
FrameworkPackages\FrameworkPackages.net9.0.cs (1)
18private static NuGetFramework Net90 { get; } = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(9, 0));
GenerateBundle.cs (1)
103Version version = new(TargetFrameworkVersion);
GenerateSupportedTargetFrameworkAlias.cs (2)
33if (!(targetFramework.Framework.Equals(".NETCoreApp") && targetFramework.Version >= new Version(5, 0)) || UseWpf || UseWindowsForms) 46if ((UseWindowsForms || UseWpf) && currentTargetFramework.Framework.Equals(".NETCoreApp") && currentTargetFramework.Version >= new Version(5, 0))
GetPackagesToPrune.cs (2)
319currentVersion = new Version(currentVersion.Major, currentVersion.Minor - 1); 325currentVersion = new Version(currentVersion.Major - 1, 0);
ProcessFrameworkReferences.cs (7)
451_normalizedTargetFrameworkVersion = NormalizeVersion(new Version(TargetFrameworkVersion)); 467_normalizedTargetFrameworkVersion ??= NormalizeVersion(new Version(TargetFrameworkVersion)); 1004var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); 1012var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); 1020var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); 1264return new Version(version.Major, version.Minor); 1268return new Version(version.Major, version.Minor, version.Build);
ResolveAppHosts.cs (1)
86var normalizedTargetFrameworkVersion = ProcessFrameworkReferences.NormalizeVersion(new Version(TargetFrameworkVersion));
src\sdk\src\Common\EnvironmentVariableNames.cs (1)
61private static readonly Version s_version6_0 = new(6, 0);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Tasks\Common\FileUtilities.cs (1)
18return new Version(fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
Microsoft.NET.HostModel (1)
ComHost\TypeLibReader.cs (1)
62version = new Version(majorVer, minorVer);
Microsoft.NET.Sdk.Publish.Tasks (7)
MsDeploy\CommonUtility.cs (6)
483currentMinVersion = new Version(s_strMinimumVersion); 487currentMinVersion = new Version(7, 1, 614); // current drop 511currentMinVersion = new Version(strMinimumVersion); 524Version minVersion = new(currentMinVersion.Major, currentMinVersion.Minor); 557new System.Version(3, 6), 1812Version[] versionArray = versionsList.Values.Select(p => new Version(p)).ToArray();
src\sdk\src\Common\EnvironmentVariableNames.cs (1)
61private static readonly Version s_version6_0 = new(6, 0);
Microsoft.NET.Sdk.Razor.Tasks (1)
SdkRazorGenerate.cs (1)
105parsedVersion = new System.Version(2, 1);
Microsoft.NET.Sdk.WorkloadManifestReader (3)
SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Common\EnvironmentVariableNames.cs (1)
61private static readonly Version s_version6_0 = new(6, 0);
Microsoft.SourceLink.Bitbucket.Git (1)
GetSourceLinkUrl.cs (1)
25private static readonly Version s_versionWithNewUrlFormat = new Version(4, 7);
Microsoft.SourceLink.GitLab (1)
GetSourceLinkUrl.cs (1)
24private static readonly Version s_versionWithNewUrlFormat = new Version(12, 0);
Microsoft.TestPlatform.CoreUtilities (1)
Helpers\FileHelper.cs (1)
19private static readonly Version DefaultFileVersion = new(0, 0);
Microsoft.TestPlatform.TestHostRuntimeProvider (5)
Hosting\DotnetTestHostManager.cs (5)
446var suffix = _targetFramework.Version == "1.0.0.0" ? "latest" : $"{new Version(_targetFramework.Version).Major}.{new Version(_targetFramework.Version).Minor}"; 521&& version < new Version(3, 0)) 692new Version(_targetFramework.Version).Major < 6) 700new Version(_targetFramework.Version).Major < 5 &&
Microsoft.VisualStudio.TestPlatform.ObjectModel (90)
Nuget.Frameworks\DefaultFrameworkMappings.cs (15)
132new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 136new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)), 137new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 142new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 147new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 152new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0))), 162new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(3, 0, 0, 0), "WindowsPhone")), 166new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, new Version(7, 1, 0, 0)), 167new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0), "WindowsPhone71")), 172new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 0, 0, 0), "WindowsPhone")), 177new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 1, 0, 0), "WindowsPhone")), 294new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)))), 302new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)))), 318new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0)))), 337new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, new Version(10, 0, 15064, 0)),
Nuget.Frameworks\DefaultPortableFrameworkMappings.cs (6)
110var monoandroid = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoAndroid, new Version(0, 0)); 111var monotouch = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoTouch, new Version(0, 0)); 112var xamarinIOs = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinIOs, new Version(0, 0)); 113var xamarinMac = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinMac, new Version(0, 0)); 114var xamarinTVOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinTVOS, new Version(0, 0)); 115var xamarinWatchOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinWatchOS, new Version(0, 0));
Nuget.Frameworks\FrameworkConstants.cs (65)
11public static readonly Version EmptyVersion = new(0, 0, 0, 0); 12public static readonly Version MaxVersion = new(int.MaxValue, 0, 0, 0); 13public static readonly Version Version5 = new(5, 0, 0, 0); 14public static readonly Version Version6 = new(6, 0, 0, 0); 15public static readonly Version Version7 = new(7, 0, 0, 0); 16public static readonly Version Version10 = new(10, 0, 0, 0); 77public static readonly NuGetFramework Net11 = new(FrameworkIdentifiers.Net, new Version(1, 1, 0, 0)); 78public static readonly NuGetFramework Net2 = new(FrameworkIdentifiers.Net, new Version(2, 0, 0, 0)); 79public static readonly NuGetFramework Net35 = new(FrameworkIdentifiers.Net, new Version(3, 5, 0, 0)); 80public static readonly NuGetFramework Net4 = new(FrameworkIdentifiers.Net, new Version(4, 0, 0, 0)); 81public static readonly NuGetFramework Net403 = new(FrameworkIdentifiers.Net, new Version(4, 0, 3, 0)); 82public static readonly NuGetFramework Net45 = new(FrameworkIdentifiers.Net, new Version(4, 5, 0, 0)); 83public static readonly NuGetFramework Net451 = new(FrameworkIdentifiers.Net, new Version(4, 5, 1, 0)); 84public static readonly NuGetFramework Net452 = new(FrameworkIdentifiers.Net, new Version(4, 5, 2, 0)); 85public static readonly NuGetFramework Net46 = new(FrameworkIdentifiers.Net, new Version(4, 6, 0, 0)); 86public static readonly NuGetFramework Net461 = new(FrameworkIdentifiers.Net, new Version(4, 6, 1, 0)); 87public static readonly NuGetFramework Net462 = new(FrameworkIdentifiers.Net, new Version(4, 6, 2, 0)); 88public static readonly NuGetFramework Net463 = new(FrameworkIdentifiers.Net, new Version(4, 6, 3, 0)); 89public static readonly NuGetFramework Net47 = new(FrameworkIdentifiers.Net, new Version(4, 7, 0, 0)); 90public static readonly NuGetFramework Net471 = new(FrameworkIdentifiers.Net, new Version(4, 7, 1, 0)); 91public static readonly NuGetFramework Net472 = new(FrameworkIdentifiers.Net, new Version(4, 7, 2, 0)); 93public static readonly NuGetFramework NetCore45 = new(FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)); 94public static readonly NuGetFramework NetCore451 = new(FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0)); 95public static readonly NuGetFramework NetCore50 = new(FrameworkIdentifiers.NetCore, new Version(5, 0, 0, 0)); 97public static readonly NuGetFramework Win8 = new(FrameworkIdentifiers.Windows, new Version(8, 0, 0, 0)); 98public static readonly NuGetFramework Win81 = new(FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)); 99public static readonly NuGetFramework Win10 = new(FrameworkIdentifiers.Windows, new Version(10, 0, 0, 0)); 101public static readonly NuGetFramework SL4 = new(FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0)); 102public static readonly NuGetFramework SL5 = new(FrameworkIdentifiers.Silverlight, new Version(5, 0, 0, 0)); 104public static readonly NuGetFramework WP7 = new(FrameworkIdentifiers.WindowsPhone, new Version(7, 0, 0, 0)); 105public static readonly NuGetFramework WP75 = new(FrameworkIdentifiers.WindowsPhone, new Version(7, 5, 0, 0)); 106public static readonly NuGetFramework WP8 = new(FrameworkIdentifiers.WindowsPhone, new Version(8, 0, 0, 0)); 107public static readonly NuGetFramework WP81 = new(FrameworkIdentifiers.WindowsPhone, new Version(8, 1, 0, 0)); 108public static readonly NuGetFramework WPA81 = new(FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)); 110public static readonly NuGetFramework Tizen3 = new(FrameworkIdentifiers.Tizen, new Version(3, 0, 0, 0)); 111public static readonly NuGetFramework Tizen4 = new(FrameworkIdentifiers.Tizen, new Version(4, 0, 0, 0)); 112public static readonly NuGetFramework Tizen6 = new(FrameworkIdentifiers.Tizen, new Version(6, 0, 0, 0)); 120public static readonly NuGetFramework Dnx45 = new(FrameworkIdentifiers.Dnx, new Version(4, 5, 0, 0)); 121public static readonly NuGetFramework Dnx451 = new(FrameworkIdentifiers.Dnx, new Version(4, 5, 1, 0)); 122public static readonly NuGetFramework Dnx452 = new(FrameworkIdentifiers.Dnx, new Version(4, 5, 2, 0)); 131= new(FrameworkIdentifiers.NetPlatform, new Version(5, 1, 0, 0)); 133= new(FrameworkIdentifiers.NetPlatform, new Version(5, 2, 0, 0)); 135= new(FrameworkIdentifiers.NetPlatform, new Version(5, 3, 0, 0)); 137= new(FrameworkIdentifiers.NetPlatform, new Version(5, 4, 0, 0)); 139= new(FrameworkIdentifiers.NetPlatform, new Version(5, 5, 0, 0)); 141= new(FrameworkIdentifiers.NetPlatform, new Version(5, 6, 0, 0)); 146= new(FrameworkIdentifiers.NetStandard, new Version(1, 0, 0, 0)); 148= new(FrameworkIdentifiers.NetStandard, new Version(1, 1, 0, 0)); 150= new(FrameworkIdentifiers.NetStandard, new Version(1, 2, 0, 0)); 152= new(FrameworkIdentifiers.NetStandard, new Version(1, 3, 0, 0)); 154= new(FrameworkIdentifiers.NetStandard, new Version(1, 4, 0, 0)); 156= new(FrameworkIdentifiers.NetStandard, new Version(1, 5, 0, 0)); 158= new(FrameworkIdentifiers.NetStandard, new Version(1, 6, 0, 0)); 160= new(FrameworkIdentifiers.NetStandard, new Version(1, 7, 0, 0)); 162= new(FrameworkIdentifiers.NetStandard, new Version(2, 0, 0, 0)); 164= new(FrameworkIdentifiers.NetStandard, new Version(2, 1, 0, 0)); 167= new(FrameworkIdentifiers.NetStandardApp, new Version(1, 5, 0, 0)); 173= new(FrameworkIdentifiers.NetCoreApp, new Version(1, 0, 0, 0)); 175= new(FrameworkIdentifiers.NetCoreApp, new Version(1, 1, 0, 0)); 177= new(FrameworkIdentifiers.NetCoreApp, new Version(2, 0, 0, 0)); 179= new(FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0)); 181= new(FrameworkIdentifiers.NetCoreApp, new Version(2, 2, 0, 0)); 183= new(FrameworkIdentifiers.NetCoreApp, new Version(3, 0, 0, 0)); 185= new(FrameworkIdentifiers.NetCoreApp, new Version(3, 1, 0, 0)); 192public static readonly NuGetFramework Native = new(FrameworkIdentifiers.Native, new Version(0, 0, 0, 0));
Nuget.Frameworks\FrameworkExpander.cs (1)
89new NuGetFramework(framework.Framework, new Version(0, 0), framework.Profile),
Nuget.Frameworks\NuGetFramework.cs (1)
474normalized = new Version(
Nuget.Frameworks\NuGetFrameworkFactory.cs (2)
181version = new Version(0, 0); 223platformVersion = new Version(0, 0);
Mono.Cecil (10)
Mono.Cecil\AssemblyNameReference.cs (4)
193 name.Version = new Version (parts [1]); 253 public static Version ZeroVersion = new Version (0, 0, 0 ,0); 261 return new Version (version.Major, version.Minor, 0, 0); 264 return new Version (version.Major, version.Minor, version.Build, 0);
Mono.Cecil\AssemblyReader.cs (1)
787 name.Version = new Version (
Mono.Cecil\TypeSystem.cs (3)
117 return new Version (1, 0, 0, 0); 119 return new Version (2, 0, 0, 0); 121 return new Version (4, 0, 0, 0);
Mono.Cecil\WindowsRuntimeProjections.cs (2)
112 static readonly Version version = new Version (4, 0, 0, 0); 199 Version corlib_version = new Version (255, 255, 255, 255);
NuGet.Commands (2)
Utility\MSBuildProjectFrameworkUtility.cs (2)
359new Version("8.1"), framework.Profile); 366new Version("8.0"), framework.Profile);
NuGet.Frameworks (95)
DefaultFrameworkMappings.cs (15)
131new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 135new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)), 136new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 141new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 146new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 151new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0))), 161new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(3, 0, 0, 0), "WindowsPhone")), 165new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, new Version(7, 1, 0, 0)), 166new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0), "WindowsPhone71")), 171new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 0, 0, 0), "WindowsPhone")), 176new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 1, 0, 0), "WindowsPhone")), 293new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)))), 301new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)))), 317new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0)))), 336new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, new Version(10, 0, 15064, 0)),
DefaultPortableFrameworkMappings.cs (6)
110var monoandroid = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoAndroid, new Version(0, 0)); 111var monotouch = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoTouch, new Version(0, 0)); 112var xamarinIOs = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinIOs, new Version(0, 0)); 113var xamarinMac = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinMac, new Version(0, 0)); 114var xamarinTVOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinTVOS, new Version(0, 0)); 115var xamarinWatchOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinWatchOS, new Version(0, 0));
FrameworkConstants.cs (70)
10public static readonly Version EmptyVersion = new Version(0, 0, 0, 0); 11public static readonly Version MaxVersion = new Version(int.MaxValue, 0, 0, 0); 12public static readonly Version Version5 = new Version(5, 0, 0, 0); 13public static readonly Version Version6 = new Version(6, 0, 0, 0); 14public static readonly Version Version7 = new Version(7, 0, 0, 0); 15public static readonly Version Version8 = new Version(8, 0, 0, 0); 16public static readonly Version Version9 = new Version(9, 0, 0, 0); 17public static readonly Version Version10 = new Version(10, 0, 0, 0); 18public static readonly Version Version11 = new Version(11, 0, 0, 0); 80public static readonly NuGetFramework Net11 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(1, 1, 0, 0)); 82public static readonly NuGetFramework Net2 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(2, 0, 0, 0)); 84public static readonly NuGetFramework Net35 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(3, 5, 0, 0)); 86public static readonly NuGetFramework Net4 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 0, 0)); 88public static readonly NuGetFramework Net403 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 3, 0)); 90public static readonly NuGetFramework Net45 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 0, 0)); 92public static readonly NuGetFramework Net451 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 1, 0)); 94public static readonly NuGetFramework Net452 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 2, 0)); 96public static readonly NuGetFramework Net46 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 0, 0)); 98public static readonly NuGetFramework Net461 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 1, 0)); 100public static readonly NuGetFramework Net462 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 2, 0)); 102public static readonly NuGetFramework Net463 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 3, 0)); 104public static readonly NuGetFramework Net47 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 0, 0)); 106public static readonly NuGetFramework Net471 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 1, 0)); 108public static readonly NuGetFramework Net472 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 2, 0)); 110public static readonly NuGetFramework Net48 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 0, 0)); 112public static readonly NuGetFramework Net481 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 1, 0)); 116public static readonly NuGetFramework NetCore45 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)); 119public static readonly NuGetFramework NetCore451 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0)); 122public static readonly NuGetFramework NetCore50 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(5, 0, 0, 0)); 124public static readonly NuGetFramework Win8 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 0, 0, 0)); 125public static readonly NuGetFramework Win81 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)); 126public static readonly NuGetFramework Win10 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(10, 0, 0, 0)); 128public static readonly NuGetFramework SL4 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0)); 129public static readonly NuGetFramework SL5 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(5, 0, 0, 0)); 131public static readonly NuGetFramework WP7 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 0, 0, 0)); 132public static readonly NuGetFramework WP75 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 5, 0, 0)); 133public static readonly NuGetFramework WP8 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 0, 0, 0)); 134public static readonly NuGetFramework WP81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 1, 0, 0)); 135public static readonly NuGetFramework WPA81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)); 137public static readonly NuGetFramework Tizen3 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(3, 0, 0, 0)); 138public static readonly NuGetFramework Tizen4 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(4, 0, 0, 0)); 139public static readonly NuGetFramework Tizen6 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(6, 0, 0, 0)); 147public static readonly NuGetFramework Dnx45 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 0, 0)); 148public static readonly NuGetFramework Dnx451 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 1, 0)); 149public static readonly NuGetFramework Dnx452 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 2, 0)); 158= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 1, 0, 0)); 160= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 2, 0, 0)); 162= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 3, 0, 0)); 164= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 4, 0, 0)); 166= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 5, 0, 0)); 168= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 6, 0, 0)); 174= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 0, 0, 0)); 177= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 1, 0, 0)); 180= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 2, 0, 0)); 183= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 3, 0, 0)); 186= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 4, 0, 0)); 189= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 5, 0, 0)); 192= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 6, 0, 0)); 195= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 7, 0, 0)); 198= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(2, 0, 0, 0)); 201= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(2, 1, 0, 0)); 204= new NuGetFramework(FrameworkIdentifiers.NetStandardApp, new Version(1, 5, 0, 0)); 211= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(1, 0, 0, 0)); 214= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(1, 1, 0, 0)); 217= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 0, 0, 0)); 220= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0)); 223= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 2, 0, 0)); 226= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(3, 0, 0, 0)); 229= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(3, 1, 0, 0)); 247public static readonly NuGetFramework Native = new NuGetFramework(FrameworkIdentifiers.Native, new Version(0, 0, 0, 0));
FrameworkExpander.cs (1)
89new NuGetFramework(framework.Framework, new Version(0, 0), framework.Profile),
NuGetFramework.cs (1)
475normalized = new Version(
NuGetFrameworkFactory.cs (2)
178version = new Version(0, 0); 220platformVersion = new Version(0, 0);
NuGet.Packaging (3)
Core\PackageType.cs (1)
14public static readonly Version EmptyVersion = new Version(0, 0);
PackageCreation\Authoring\LicenseMetadata.cs (2)
18public static readonly Version EmptyVersion = new Version(1, 0, 0); 19public static readonly Version CurrentVersion = new Version(1, 0, 0);
NuGet.Versioning (7)
FloatRange.cs (1)
227range = new FloatRange(NuGetVersionFloatBehavior.Major, new NuGetVersion(new Version(0, 0)));
NuGetVersion.cs (2)
94: this(new Version(major, minor, patch, 0), releaseLabels, metadata, null) 134: this(new Version(major, minor, patch, revision), releaseLabels, metadata, null)
NuGetVersionFactory.cs (1)
153version = new Version(major, minor, build, revision);
SemanticVersion.cs (2)
80: this(new Version(major, minor, patch, 0), releaseLabels, metadata) 119: this(new Version(major, minor, patch, revision), releaseLabels, metadata)
SemanticVersionFactory.cs (1)
237normalized = new Version(
PresentationBuildTasks (4)
MS\Internal\MarkupCompiler\VersionHelper.cs (4)
16private static readonly Version NullVersion = new Version(0, 0, 0, 0); 157version = new Version(values[0], values[1], values[2], values[3]); 206return new Version(pattern.Major, pattern.Minor, (ushort)build, (ushort)revision); 210return new Version(pattern.Major, pattern.Minor, pattern.Build, (ushort)revision);
PresentationCore (5)
System\Windows\Media\Imaging\BitmapCodecInfo.cs (4)
144return new Version(version.ToString()); 146return new Version(); 187return new Version(specVersion.ToString()); 189return new Version();
System\Windows\Navigation\BaseUriHelper.cs (1)
203asmName.Version = new Version(assemblyVersion);
PresentationFramework (5)
System\Windows\Documents\Serialization\SerializerDescriptor.cs (2)
168sd._assemblyVersion = new Version(GetNonEmptyRegistryString(key, "assemblyVersion")); 169sd._winFXVersion = new Version(GetNonEmptyRegistryString(key, "winFXVersion"));
System\Windows\Standard\Utilities.cs (3)
77get { return _osVersion >= new Version(6, 0); } 81get { return _osVersion >= new Version(6, 1); } 87public static bool IsOSWindows8OrNewer => _osVersion >= new Version(6, 2);
RepoTasks (1)
FileUtilities.cs (1)
24return new Version(fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
100yield return new TestData<Version>(new(1, 2, 3, 4), """{"$comment":"Represents a version string.", "type":["string","null"],"pattern":"^\\d+(\\.\\d+){1,3}$"}""");
System.ComponentModel.TypeConverter (2)
System\ComponentModel\VersionConverter.cs (2)
56return new Version(version.Major, version.Minor, version.Build, version.Revision); // return new instance 86return new Version(version.Major, version.Minor, version.Build, version.Revision);
System.Data.Common (2)
System\Data\DataSet.cs (1)
329info.AddValue("DataSet.RemotingVersion", new Version(2, 0));
System\Data\DataTable.cs (1)
243info.AddValue("DataTable.RemotingVersion", new Version(2, 0));
System.Diagnostics.DiagnosticSource (1)
src\runtime\artifacts\obj\System.Diagnostics.DiagnosticSource\Release\net11.0\ThisAssembly.cs (1)
10public static Version AssemblyFileVersion { get; } = new(BuildAssemblyFileVersion);
System.Management (2)
System\Management\InteropClasses\WMIInterop.cs (1)
1372if (os.Platform == PlatformID.Win32NT && os.Version >= new Version(5, 0))
System\Management\WMIGenerator.cs (1)
4878assemblyName.Version = new Version(VSVERSION);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1084response.SetVersionWithoutValidation(new Version(1, minorVersion - '0'));
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpHandler.cs (3)
43internal static readonly Version HttpVersion20 = new Version(2, 0); 44internal static readonly Version HttpVersion30 = new Version(3, 0); 45internal static readonly Version HttpVersionUnknown = new Version(0, 0);
System.Net.HttpListener (1)
System\Net\Managed\HttpListenerResponse.Managed.cs (1)
70_version = new Version(value.Major, value.Minor); // match Windows behavior, trimming to just Major.Minor
System.Net.Primitives (5)
System\Net\HttpVersion.cs (5)
9public static readonly Version Unknown = new Version(0, 0); 11public static readonly Version Version10 = new Version(1, 0); 13public static readonly Version Version11 = new Version(1, 1); 15public static readonly Version Version20 = new Version(2, 0); 17public static readonly Version Version30 = new Version(3, 0);
System.Net.Quic (4)
System\Net\Quic\Internal\MsQuicApi.cs (4)
21private static readonly Version s_minWindowsVersion = new Version(10, 0, 20145, 1000); 23private static readonly Version s_minMsQuicVersion = new Version(2, 2, 2); 67internal static bool SupportsAsyncCertValidation => Version > new Version(2, 4); 161Version = new Version((int)libVersion[0], (int)libVersion[1], (int)libVersion[2], (int)libVersion[3]);
System.Net.Requests (1)
System\Net\ServicePoint\ServicePoint.cs (1)
69public virtual Version ProtocolVersion { get; internal set; } = new Version(1, 1);
System.Private.CoreLib (10)
_generated\1\ProductVersionInfo.g.cs (1)
10public static Version Version => new Version(11, 0, 0);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (3)
283versionNumbers[2] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1]) : 284versionNumbers[3] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2]) : 285new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.OSVersion.Unix.cs (1)
27return new OperatingSystem(PlatformID.Unix, new Version(major, minor, build, revision));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (4)
96return new Version(this); 410new Version(major, minor, build, revision) : 417new Version(major, minor, build) : 425new Version(major, minor) :
System\Reflection\Runtime\General\MetadataReaderExtensions.cs (1)
134new Version(majorVersion, minorVersion, buildNumber, revisionNumber),
System.Private.Xml (1)
System\Xml\Serialization\CodeGenerator.cs (1)
1283assemblyName.Version = new Version(1, 0, 0, 0);
System.Reflection.Emit (2)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
981version: version ?? new Version(0, 0, 0, 0),
System\Reflection\Emit\PersistedAssemblyBuilder.cs (1)
156version: _assemblyName.Version ?? new Version(0, 0, 0, 0),
System.Reflection.Metadata (6)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (3)
283versionNumbers[2] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1]) : 284versionNumbers[3] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2]) : 285new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]);
System\Reflection\Metadata\Internal\Tables.cs (2)
1962return new Version( 2090return new Version(
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (1)
16private static readonly Version s_version_4_0_0_0 = new Version(4, 0, 0, 0);
System.Reflection.MetadataLoadContext (4)
System\Reflection\TypeLoading\General\Helpers.cs (3)
1610b0001 => new Version(v.Major, v.Minor, v.Build), 1620b0010 => new Version(v.Major, v.Minor), 1630b0011 => new Version(v.Major, v.Minor),
System\Reflection\TypeLoading\General\RoAssemblyName.cs (1)
33private static readonly Version s_Version0000 = new Version(0, 0, 0, 0);
System.Windows.Forms (5)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
1128if (Environment.OSVersion.Version >= new Version(10, 0, 22000)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
614return new Version(fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
System\Windows\Forms\FeatureSupport.cs (2)
18return IsPresent(featureClassName, featureConstName, new Version(0, 0, 0, 0)); 73public virtual bool IsPresent(object feature) => IsPresent(feature, new Version(0, 0, 0, 0));
System\Windows\Forms\OSFeature.cs (1)
45return new Version(0, 0, 0, 0);
1530 references to Version
aspire (17)
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (15)
139var clientVersion = versionInfo.ClientVersion; 140var serverVersion = versionInfo.ServerVersion; 201var minimumVersion = GetMinimumVersion(runtime); 368internal static Version? ParseVersionFromOutput(string output) 378if (match.Success && Version.TryParse(match.Groups[1].Value, out var version)) 389private static Version? GetMinimumVersion(string runtime) 393if (versionString is not null && Version.TryParse(versionString, out var version)) 497Version? ClientVersion, 498Version? ServerVersion, 520Version.TryParse(json.Client?.Version, out var clientVersion); 521Version.TryParse(json.Server?.Version, out var serverVersion);
Utils\EnvironmentChecker\DotNetSdkCheck.cs (2)
42if (Version.TryParse(minimumRequiredVersion, out var parsedVersion))
Aspire.Cli.Tests (7)
Utils\ContainerRuntimeCheckTests.cs (7)
217var result = ContainerRuntimeCheck.ParseVersionFromOutput(input); 220Assert.Equal(Version.Parse(expectedVersion), result); 231var result = ContainerRuntimeCheck.ParseVersionFromOutput(input); 239var result = ContainerRuntimeCheck.ParseVersionFromOutput(null!); 253var result = ContainerRuntimeCheck.ParseVersionFromOutput(input); 268var result = ContainerRuntimeCheck.ParseVersionFromOutput(input); 287var result = ContainerRuntimeCheck.ParseVersionFromOutput(input);
Aspire.Dashboard.Components.Tests (1)
Shared\FluentUISetupHelpers.cs (1)
23private static readonly Version s_fluentUIVersion = typeof(FluentMain).Assembly.GetName().Version!;
Aspire.Dashboard.Tests (1)
Integration\HealthTests.cs (1)
24static async Task MakeRequestAndAssert(string basePath, Version httpVersion)
Aspire.Hosting (13)
Dcp\DcpDependencyCheck.cs (4)
162if (Version.TryParse(dcpVersionString, out var dcpVersion)) 203if (Version.TryParse(assembly.GetCustomAttribute<AssemblyVersionAttribute>()?.Version, out var assemblyVersion))
Dcp\DcpVersion.cs (2)
8public static Version MinimumVersionInclusive = new Version(0, 21, 1); // Aspire 13.2 release 13public static Version Dev = new Version(1000, 0, 0);
Dcp\IDcpDependencyCheckService.cs (1)
22public Version? Version { get; set; }
DotnetToolResourceExtensions.cs (2)
114var version = await DotnetSdkUtils.TryGetVersionAsync(resource.WorkingDirectory).ConfigureAwait(false); 207internal static void ValidateDotnetSdkVersion(Version? version, string workingDirectory)
Utils\DotnetSdkUtils.cs (4)
19public static async Task<Version?> TryGetVersionAsync(string? workingDirectory) 22Version? parsedVersion = null; 40if (Version.TryParse(versionSpan, out var v))
Aspire.Hosting.DevTunnels (6)
DevTunnelCli.cs (1)
19public static readonly Version MinimumSupportedVersion = new(1, 0, 1435);
DevTunnelCliClient.cs (3)
18public async Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default) 42if (Version.TryParse(versionString, out var version))
DevTunnelResourceBuilderExtensions.cs (1)
787var version = await devTunnelClient.GetVersionAsync(logger: null, context.CancellationToken).ConfigureAwait(false);
IDevTunnelClient.cs (1)
10Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default);
Aspire.Hosting.DevTunnels.Tests (4)
DevTunnelCliVersionValidationTests.cs (4)
27var testCliVersion = Version.Parse(testVersion); 49private sealed class TestDevTunnelClient(Version cliVersion) : IDevTunnelClient 51public Task<Version> GetVersionAsync(ILogger? logger = null, CancellationToken cancellationToken = default) => Task.FromResult(cliVersion);
Aspire.Hosting.DotnetTool.Tests (2)
AddDotnetToolTests.cs (2)
387var version = Version.Parse(versionString);
Aspire.Hosting.RemoteHost (3)
IntegrationLoadContext.cs (3)
61if (TryGetDefaultContextVersion(assemblyName, out var defaultVersion)) 63var probedVersion = AssemblyName.GetAssemblyName(probedPath).Version; 76private static bool TryGetDefaultContextVersion(AssemblyName assemblyName, out Version? version)
Aspire.Hosting.Yarp (4)
ConfigurationBuilder\YarpCluster.cs (3)
230Version? parsedVersion = null; 234if (!Version.TryParse(config.Version, out var version))
YarpEnvConfigGenerator.cs (1)
67else if (obj is Version version)
Aspire.Hosting.Yarp.Tests (1)
YarpConfigGeneratorTests.cs (1)
189Version = Version.Parse("1.0"),
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
23internal static readonly Version Version = new Version(1, 0, 0, 13);
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\KnownTypeSymbols.cs (1)
84Version = compilation.GetBestTypeByMetadataName(typeof(Version));
dotnet (15)
CommandFactory\CommandResolution\PackagedCommandSpecFactoryWithCliRuntime.cs (3)
33Version currentFrameworkSimpleVersion = GetVersionWithoutPrerelease(muxer.SharedFxVersion); 34Version toolFrameworkSimpleVersion = GetVersionWithoutPrerelease(runtimeConfig.Framework.Version); 53private static Version GetVersionWithoutPrerelease(string version)
Commands\New\BuiltInTemplatePackageProvider.cs (2)
94Version? sdkVersion = typeof(NewCommandParser).Assembly.GetName().Version; 97var majorMinorDirVersion = new Version(dirInfo.Value.Major, dirInfo.Value.Minor);
Commands\Workload\WorkloadUtilities.cs (2)
23var firstVersion = new Version(first.Substring(0, firstDash)); 24var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Common\EnvironmentVariableNames.cs (6)
61private static readonly Version s_version6_0 = new(6, 0); 66public static string? TryGetDotNetRootVariableName(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion) 69internal static string? TryGetDotNetRootVariableNameImpl(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion, Architecture currentArchitecture, bool is64bit, bool onlyUseArchSpecific = false) 108public static Version? TryParseTargetFrameworkVersion(string targetFrameworkVersion) 111return !string.IsNullOrEmpty(targetFrameworkVersion) && Version.TryParse(targetFrameworkVersion.Substring(1), out var version) ? version : null;
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
31if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))
dotnet-svcutil-lib (8)
Shared\FrameworkInfo.cs (2)
26public Version Version { get; private set; } 32Version version = null;
Shared\TargetFrameworkHelper.cs (6)
17public static Version MinSupportedNetFxVersionForDotNet { get; } = new Version("4.5"); 18public static Version MinSupportedNetStandardVersion { get; } = new Version("1.3"); 19public static Version MinSupportedNetCoreAppVersion { get; } = new Version("1.0"); 66Version netCoreVersion = GetLowestNetCoreVersion(targetFrameworks); 106public static Version GetLowestNetCoreVersion(IEnumerable<string> targetFrameworks) 108Version targetVersion = null;
GenerateDocumentationAndConfigFiles (37)
Program.cs (12)
440Debug.Assert(Version.TryParse(args.AnalyzerVersion, out _)); 869using var _2 = PooledHashSet<Version>.GetInstance(out var versionsBuilder); 971foreach (var version in versionsBuilder) 980var maxShippedVersion = versionsBuilder.Max(); 981var unshippedVersion = new Version(maxShippedVersion!.Major + 1, maxShippedVersion.Minor); 989Version version, 1009Version version, 1051static string GetNormalizedVersionStringForEditorconfigFileNameSuffix(Version version) 1056static int GetVersionFieldCount(Version version) 1386(ImmutableArray<ReleaseTrackingData> releaseTrackingData, Version version, bool isShippedVersion) releaseTrackingDataAndVersion) 1413(ImmutableArray<ReleaseTrackingData> releaseTrackingData, Version version, bool isShippedVersion)? releaseTrackingDataAndVersion) 1530var maxVersion = releaseTrackingDataAndVersion.Value.isShippedVersion ?
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (23)
42internal static Version UnshippedVersion { get; } = new Version(int.MaxValue, int.MaxValue); 47Action<string, Version, string, SourceText, TextLine> onDuplicateEntryInRelease, 52var currentVersion = UnshippedVersion; 55using var _ = PooledHashSet<Version>.GetInstance(out var versionsBuilder); 78if (!Version.TryParse(versionString, out var version)) 338public ImmutableHashSet<Version> Versions { get; } 341: this(ImmutableSortedDictionary<string, ReleaseTrackingDataForRule>.Empty, ImmutableHashSet<Version>.Empty) 345internal ReleaseTrackingData(ImmutableSortedDictionary<string, ReleaseTrackingDataForRule> releaseTrackingDataByRuleIdMap, ImmutableHashSet<Version> versions) 353[NotNullWhen(returnValue: true)] out Version? version, 359Version maxVersion, 360[NotNullWhen(returnValue: true)] out Version? version, 366Version? maxVersion, 367[NotNullWhen(returnValue: true)] out Version? version, 397public ImmutableSortedDictionary<Version, ReleaseTrackingLine> ReleasesByVersionMap { get; } 408private readonly ImmutableSortedDictionary<Version, ReleaseTrackingLine>.Builder _builder 409= ImmutableSortedDictionary.CreateBuilder<Version, ReleaseTrackingLine>(ReverseComparer.Instance); 411public void AddEntry(Version version, ReleaseTrackingLine releaseTrackingLine, out bool hasExistingEntry) 417public ImmutableSortedDictionary<Version, ReleaseTrackingLine> ToImmutable() 420private sealed class ReverseComparer : IComparer<Version> 422public static readonly IComparer<Version> Instance = new ReverseComparer(); 425public int Compare([AllowNull] Version x, [AllowNull] Version y)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
36var assemblyVersion = thisAssemblyName.Version;
ILAssembler (2)
EntityRegistry.cs (2)
1082public AssemblyReferenceEntity GetOrCreateAssemblyReference(string name, Version version, string? culture, BlobBuilder? publicKeyOrToken, AssemblyFlags flags, ProcessorArchitecture architecture) 1471public Version? Version { get; set; }
ILCompiler.Build.Tasks (1)
ComputeManagedAssembliesToCompileToNative.cs (1)
158static Version GetFileVersion(string path)
ILCompiler.Compiler (4)
Compiler\AssemblyExtensions.cs (3)
16public static Version? GetTargetFrameworkVersion(this EcmaAssembly assembly) 33if (Version.TryParse(versionStr, out var version))
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (1)
142Version version = name.Version ?? new Version(0, 0);
ILCompiler.Diagnostics (1)
PdbWriter.cs (1)
442Version compilerVersion = null;
ILCompiler.ReadyToRun (6)
Compiler\CompositeImageSettings.cs (1)
12public Version AssemblyVersion;
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (1)
96Version manifestAssemblyVersion = new Version(0, 0, 0, 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (1)
142Version version = name.Version ?? new Version(0, 0);
TypeSystem\Mutable\MutableModule.cs (3)
151Version _version; 155public Cache(MutableModule module, string assemblyName, AssemblyFlags assemblyFlags, byte[] publicKeyArray, Version version, AssemblyHashAlgorithm hashAlgorithm, Func<ModuleDesc, int> moduleToIndex) 291Version version,
illink (3)
ILLink.RoslynAnalyzer (8)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (2)
13public static unsafe string ComputeDisplayName(string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null) 20public static void AppendDisplayName(ref ValueStringBuilder vsb, string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (4)
20public AssemblyNameParts(string name, Version? version, string? cultureName, AssemblyNameFlags flags, byte[]? publicKeyOrToken) 30public readonly Version? _version; 110Version? version = null; 247private static unsafe bool TryParseVersion(string attributeValue, ref Version? version)
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\AssemblyNameInfo.cs (2)
42public AssemblyNameInfo(string name, Version? version = null, string? cultureName = null, AssemblyNameFlags flags = AssemblyNameFlags.None, ImmutableArray<byte> publicKeyOrToken = default) 79public Version? Version { get; }
installer.tasks (8)
FileUtilities.cs (1)
18public static Version GetFileVersion(string sourcePath)
GenerateFileVersionProps.cs (6)
17private static readonly Version ZeroVersion = new Version(0, 0, 0, 0); 179Version assemblyVersion, fileVersion; 181Version.TryParse(file.GetMetadata("AssemblyVersion"), out assemblyVersion); 182Version.TryParse(file.GetMetadata("FileVersion"), out fileVersion); 202public Version AssemblyVersion { get; set; } 203public Version FileVersion { get; set; }
GenerateTestSharedFrameworkDepsFile.cs (1)
63Version assemblyVersion = FileUtilities.GetAssemblyName(filePath)?.Version;
Microsoft.AspNetCore.Http.Abstractions (2)
HttpProtocol.cs (2)
106/// Gets the HTTP request protocol for the specified <see cref="Version"/>. 110public static string GetHttpProtocol(Version version)
Microsoft.AspNetCore.Server.IIS (1)
SourceBuildStubs.cs (1)
119Version IISVersion { get; }
Microsoft.Build (68)
BackEnd\Components\SdkResolution\SdkResolverContext.cs (1)
15public SdkResolverContext(Framework.SdkLogger logger, string projectFilePath, string solutionPath, Version msBuildVersion, bool interactive, bool isRunningInVisualStudio)
Construction\Solution\SolutionFile.cs (9)
126private Version _currentVisualStudioVersion; 578if (!System.Version.TryParse(fileVersionFromHeader, out Version version)) 603Version visualStudioVersion = ParseVisualStudioVersion(line); 974private static Version ParseVisualStudioVersion(string str) 976Version currentVisualStudioVersion = null; 983if (!System.Version.TryParse(versionStr, out currentVisualStudioVersion)) 1006if (!System.Version.TryParse(versionString, out Version version))
Definition\ProjectCollection.cs (2)
111private static Version s_engineVersion; 485public static Version Version
Definition\Toolset.cs (4)
444SortedDictionary<Version, string> subToolsetsWithVersion = new SortedDictionary<Version, string>(); 449Version subToolsetVersion = VersionUtilities.ConvertToVersion(subToolsetName); 700Version visualStudioVersionFromSolutionAsVersion = new Version(visualStudioVersionFromSolution, 0);
Evaluation\Conditionals\GenericExpressionNode.cs (1)
18internal abstract bool TryVersionEvaluate(ConditionEvaluator.IConditionEvaluationState state, out Version result);
Evaluation\Conditionals\GreaterThanExpressionNode.cs (4)
27protected override bool Compare(Version left, Version right) 35protected override bool Compare(Version left, double right) 50protected override bool Compare(double left, Version right)
Evaluation\Conditionals\GreaterThanOrEqualExpressionNode.cs (4)
27protected override bool Compare(Version left, Version right) 35protected override bool Compare(Version left, double right) 50protected override bool Compare(double left, Version right)
Evaluation\Conditionals\LessThanExpressionNode.cs (4)
32protected override bool Compare(Version left, Version right) 43protected override bool Compare(Version left, double right) 61protected override bool Compare(double left, Version right)
Evaluation\Conditionals\LessThanOrEqualExpressionNode.cs (4)
27protected override bool Compare(Version left, Version right) 35protected override bool Compare(Version left, double right) 50protected override bool Compare(double left, Version right)
Evaluation\Conditionals\NumericComparisonExpressionNode.cs (6)
23protected abstract bool Compare(Version left, Version right); 28protected abstract bool Compare(Version left, double right); 33protected abstract bool Compare(double left, Version right); 41bool isLeftVersion = LeftChild.TryVersionEvaluate(state, out Version leftVersion); 43bool isRightVersion = RightChild.TryVersionEvaluate(state, out Version rightVersion);
Evaluation\Conditionals\NumericExpressionNode.cs (2)
35internal override bool TryVersionEvaluate(ConditionEvaluator.IConditionEvaluationState state, out Version? result) 37return Version.TryParse(_value, out result);
Evaluation\Conditionals\OperatorExpressionNode.cs (1)
29internal override bool TryVersionEvaluate(ConditionEvaluator.IConditionEvaluationState state, out Version result)
Evaluation\Conditionals\StringExpressionNode.cs (3)
51internal override bool TryVersionEvaluate(ConditionEvaluator.IConditionEvaluationState state, out Version result) 55result = Version.Parse(MSBuildConstants.CurrentVisualStudioVersion); 60return Version.TryParse(GetExpandedValue(state), out result);
Evaluation\Expander\ArgumentParser.cs (3)
149internal static bool TryGetArg(object[] args, out Version? arg0) 160internal static bool TryConvertToVersion(object value, out Version? arg0) 164if (string.IsNullOrEmpty(val) || !Version.TryParse(val, out arg0))
Evaluation\Expander\WellKnownFunctions.cs (6)
660if (ParseArgs.TryGetArg(args, out Version? arg0) && arg0 != null) 863else if (receiverType == typeof(Version)) 865if (string.Equals(methodName, nameof(Version.Parse), StringComparison.OrdinalIgnoreCase)) 869returnVal = Version.Parse(arg0); 920else if (string.Equals(methodName, nameof(Version.ToString), StringComparison.OrdinalIgnoreCase) && objectInstance is Version v)
Evaluation\IntrinsicFunctions.cs (1)
660internal static bool AreFeaturesEnabled(Version wave)
Resources\Constants.cs (1)
313availableStaticMethods.TryAdd("System.Version", new Tuple<string, Type>(null, typeof(Version)));
Resources\MSBuildAssemblyFileVersion.cs (3)
45Version version; 47if (String.IsNullOrEmpty(versionString) || !Version.TryParse(versionString, out version)) 50version = Version.Parse(Constants.AssemblyVersion);
Utilities\NuGetFrameworkWrapper.cs (7)
92var version = VersionProperty.GetValue(Parse(tfm)) as Version; 103var version = PlatformVersionProperty.GetValue(Parse(tfm)) as Version; 112private string GetNonZeroVersionParts(Version version, int minVersionPartCount) 130((VersionProperty.GetValue(l.parsedTfm) as Version) == (VersionProperty.GetValue(r.parsedTfm) as Version)))))
Utilities\Utilities.cs (2)
372if (Version.TryParse(toolsVersionFromProject, out var toolsVersionAsVersion))
Microsoft.Build.Framework (106)
BackEnd\Handshake.cs (1)
124var fileVersion = new Version(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion!);
BackEnd\TranslatorHelpers.cs (2)
319public static void Translate(this ITranslator translator, ref Version version) 369Version version = null;
BuildEnvironmentHelper.cs (1)
292Version v = new Version(CurrentVisualStudioVersion);
ChangeWaves.cs (18)
30internal static readonly Version Wave17_10 = new Version(17, 10); 31internal static readonly Version Wave17_12 = new Version(17, 12); 32internal static readonly Version Wave17_14 = new Version(17, 14); 33internal static readonly Version Wave18_3 = new Version(18, 3); 34internal static readonly Version Wave18_4 = new Version(18, 4); 35internal static readonly Version Wave18_5 = new Version(18, 5); 36internal static readonly Version Wave18_6 = new Version(18, 6); 37internal static readonly Version Wave18_7 = new Version(18, 7); 38internal static readonly Version Wave18_8 = new Version(18, 8); 39internal static readonly Version[] AllWaves = [Wave17_10, Wave17_12, Wave17_14, Wave18_3, Wave18_4, Wave18_5, Wave18_6, Wave18_7, Wave18_8]; 44internal static readonly Version EnableAllFeatures = new Version(999, 999); 56internal static Version LowestWave 67internal static Version HighestWave 86private static Version _cachedWave; 91internal static Version DisabledWave 176internal static bool AreFeaturesEnabled(Version wave) 200private static bool TryParseVersion(string stringVersion, out Version version) 214return Version.TryParse(stringVersion, out version);
Loader\CoreCLRAssemblyLoader.cs (1)
31private static readonly Version _currentAssemblyVersion = new Version(Microsoft.Build.Shared.MSBuildConstants.CurrentAssemblyVersion);
Loader\LoadedType.cs (1)
196Version lastVersionToForce = new Version(3, 5);
Sdk\SdkResolverContext.cs (1)
50public virtual Version MSBuildVersion { get; protected set; }
Telemetry\BuildTelemetry.cs (1)
67public Version? BuildEngineVersion { get; set; }
Utilities\AssemblyNameExtension.cs (5)
136var version = (Version)info.GetValue("ver", typeof(Version)); 287internal Version Version 326internal void ReplaceVersion(Version version)
Utilities\FrameworkLocationHelper.cs (59)
53internal static readonly Version dotNetFrameworkVersion11 = new Version(1, 1); 54internal static readonly Version dotNetFrameworkVersion20 = new Version(2, 0); 55internal static readonly Version dotNetFrameworkVersion30 = new Version(3, 0); 56internal static readonly Version dotNetFrameworkVersion35 = new Version(3, 5); 57internal static readonly Version dotNetFrameworkVersion40 = new Version(4, 0); 58internal static readonly Version dotNetFrameworkVersion45 = new Version(4, 5); 59internal static readonly Version dotNetFrameworkVersion451 = new Version(4, 5, 1); 60internal static readonly Version dotNetFrameworkVersion452 = new Version(4, 5, 2); 61internal static readonly Version dotNetFrameworkVersion46 = new Version(4, 6); 62internal static readonly Version dotNetFrameworkVersion461 = new Version(4, 6, 1); 63internal static readonly Version dotNetFrameworkVersion462 = new Version(4, 6, 2); 64internal static readonly Version dotNetFrameworkVersion47 = new Version(4, 7); 65internal static readonly Version dotNetFrameworkVersion471 = new Version(4, 7, 1); 66internal static readonly Version dotNetFrameworkVersion472 = new Version(4, 7, 2); 67internal static readonly Version dotNetFrameworkVersion48 = new Version(4, 8); 68internal static readonly Version dotNetFrameworkVersion481 = new Version(4, 8, 1); 71internal static readonly Version visualStudioVersion100 = new Version(10, 0); 72internal static readonly Version visualStudioVersion110 = new Version(11, 0); 73internal static readonly Version visualStudioVersion120 = new Version(12, 0); 74internal static readonly Version visualStudioVersion140 = new Version(14, 0); 75internal static readonly Version visualStudioVersion150 = new Version(15, 0); 76internal static readonly Version visualStudioVersion160 = new Version(16, 0); 77internal static readonly Version visualStudioVersion170 = new Version(17, 0); 78internal static readonly Version visualStudioVersion180 = new Version(18, 0); 81internal static readonly Version visualStudioVersionLatest = visualStudioVersion180; 433private static readonly Lazy<IReadOnlyDictionary<Version, DotNetFrameworkSpec>> DotNetFrameworkSpecDict = new(() => DotNetFrameworkSpecs().ToDictionary(spec => spec.Version)); 434private static readonly Lazy<IReadOnlyDictionary<Version, VisualStudioSpec>> VisualStudioSpecDict = new(() => VisualStudioSpecs.Value.ToDictionary(spec => spec.Version)); 664internal static string GetDotNetFrameworkSdkRootRegistryKey(Version dotNetFrameworkVersion, Version visualStudioVersion) 679internal static string GetDotNetFrameworkSdkInstallKeyValue(Version dotNetFrameworkVersion, Version visualStudioVersion) 694internal static string GetDotNetFrameworkVersionFolderPrefix(Version dotNetFrameworkVersion) 699internal static string GetPathToWindowsSdk(Version dotNetFrameworkVersion) 704internal static string GetPathToDotNetFrameworkReferenceAssemblies(Version dotNetFrameworkVersion) 709internal static string GetPathToDotNetFrameworkSdkTools(Version dotNetFrameworkVersion, Version visualStudioVersion) 724internal static string GetPathToDotNetFrameworkSdk(Version dotNetFrameworkVersion, Version visualStudioVersion) 769internal static string GetPathToDotNetFramework(Version version) 774internal static string GetPathToDotNetFramework(Version version, DotNetFrameworkArchitecture architecture) 1173private static VisualStudioSpec GetVisualStudioSpec(Version version) 1178private static DotNetFrameworkSpec GetDotNetFrameworkSpec(Version version) 1190private static DotNetFrameworkSpec CreateDotNetFrameworkSpecForV4(Version version, Version visualStudioVersion) 1203private static void RedirectVersionsIfNecessary(ref Version dotNetFrameworkVersion, ref Version visualStudioVersion) 1232Version version, 1236Version[] supportedDotNetFrameworkVersions) 1248public Version Version { get; } 1253public Version[] SupportedDotNetFrameworkVersions { get; } 1269public string GetDotNetFrameworkSdkRegistryKey(Version dotNetSdkVersion) 1333private readonly ConcurrentDictionary<Version, string> _pathsToDotNetFrameworkSdkTools; 1363Version version, 1370Version visualStudioVersion = null) 1378this._pathsToDotNetFrameworkSdkTools = new ConcurrentDictionary<Version, string>(); 1390public Version Version { get; } 1649private static string FallbackToDefaultPathToDotNetFrameworkSdkTools(Version dotNetFrameworkVersion) 1675Version version, 1742Version version,
Utilities\VersionUtilities.cs (14)
22internal static Version ConvertToVersion(string version) 31internal static SortedDictionary<Version, List<string>> GatherVersionStrings(Version targetPlatformVersion, IEnumerable versions) 33SortedDictionary<Version, List<string>> versionValues = new SortedDictionary<Version, List<string>>(ReverseVersionGenericComparer.Comparer); 40Version candidateVersion = VersionUtilities.ConvertToVersion(version); 67internal static Version ConvertToVersion(string version, bool throwException) 82Version result; 85result = Version.Parse(version); 89if (!Version.TryParse(version, out result)) 116internal sealed class ReverseVersionGenericComparer : IComparer<Version> 126int IComparer<Version>.Compare(Version x, Version y)
VisualStudioLocationHelper.cs (2)
119internal Version Version { get; } 131internal VisualStudioInstance(string name, string path, Version version)
Microsoft.Build.Tasks.Core (128)
AppConfig\BindingRedirect.cs (5)
21internal Version OldVersionLow { set; get; } 26internal Version OldVersionHigh { set; get; } 31internal Version NewVersion { set; get; } 51OldVersionLow = Version.Parse(oldVersion.AsSpan(0, dashPosition)); 52OldVersionHigh = Version.Parse(oldVersion.AsSpan(dashPosition + 1));
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
76FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion,
AssemblyDependency\AssemblyFoldersResolver.cs (1)
27public AssemblyFoldersResolver(string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
AssemblyDependency\AssemblyNameReferenceAscendingVersionComparer.cs (3)
17private static Version DummyVersion { get; } = new Version(0, 0); 31Version v1 = i1.assemblyName.Version; 32Version v2 = i2.assemblyName.Version;
AssemblyDependency\AssemblyResolution.cs (2)
159Version targetedRuntimeVersion, 225Version targetedRuntimeVersion,
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
35public CandidateAssemblyFilesResolver(string[] candidateAssemblyFiles, string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
AssemblyDependency\DirectoryResolver.cs (1)
31public DirectoryResolver(string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, string parentAssembly, TaskEnvironment taskEnvironment)
AssemblyDependency\FrameworkPathResolver.cs (1)
27public FrameworkPathResolver(string[] frameworkPaths, InstalledAssemblies installedAssemblies, string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
AssemblyDependency\GenerateBindingRedirects.cs (5)
270if (!Version.TryParse(oldVerStrLow, out Version oldVersionLow)) 276if (!Version.TryParse(oldVerStrHigh, out Version oldVersionHigh)) 289var maxVersion = new Version(maxVerStr);
AssemblyDependency\HintPathResolver.cs (1)
22public HintPathResolver(string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
AssemblyDependency\InstalledAssemblies.cs (1)
37out Version unifiedVersion,
AssemblyDependency\RawFilenameResolver.cs (1)
22public RawFilenameResolver(string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
AssemblyDependency\Reference.cs (4)
332internal Version ReferenceVersion { get; set; } = null; 726internal void AddPreUnificationVersion(String referencePath, Version version, UnificationReason reason) 983Version targetedRuntimeVersion, 1180internal Version HighestVersionInRedist { get; set; }
AssemblyDependency\ReferenceTable.cs (13)
30private static readonly Version s_targetFrameworkVersion_40 = new Version("4.0"); 107private readonly Version _targetedRuntimeVersion; 125private readonly Version _projectTargetFramework; 302Version targetedRuntimeVersion, 303Version projectTargetFramework, 1121bool isUnified = UnifyAssemblyNameVersions(dependentAssembly, out Version unifiedVersion, out UnificationReason unificationReason, out bool isPrerequisite, out bool? isRedistRoot, out string redistName); 1926Version version = baseKey.Version; 1933Version lastVersion = conflictingReference.assemblyName.Version; 1957var zeroVersion = new Version(0, 0, 0, 0); 2411Version leftConflictVersion = assemblyReference0.assemblyName.Version; 2412Version rightConflictVersion = assemblyReference1.assemblyName.Version; 2482Version redistListVersion = redistListEntry.AssemblyNameExtension.Version; 2505out Version unifiedVersion,
AssemblyDependency\ResolveAssemblyReference.cs (8)
224private Version _projectTargetFramework; 2358Version targetedRuntimeVersion = SetTargetedRuntimeVersion(_targetedRuntimeVersionRawValue); 2928internal static Version SetTargetedRuntimeVersion(string targetedRuntimeVersionRawValue) 2930Version versionToReturn = null; 3271private Version FrameworkVersionFromString(string version) 3273Version parsedVersion = null; 3295Version assemblyFXVersion = FrameworkVersionFromString(assemblyFXVersionAsString); 3394private string GetAssemblyPathInGac(AssemblyNameExtension assemblyName, SystemProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, FileExists fileExists, bool fullFusionName, bool specificVersion)
AssemblyDependency\Resolver.cs (2)
43protected Version targetedRuntimeVersion; 63protected Resolver(string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, ProcessorArchitecture targetedProcessorArchitecture, bool compareProcessorArchitecture, TaskEnvironment taskEnvironment)
AssemblyDependency\UnificationVersion.cs (1)
16internal Version version;
Delegate.cs (1)
107internal delegate string GetAssemblyPathInGac(AssemblyNameExtension assemblyName, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, FileExists fileExists, bool fullFusionName, bool specificVersion);
FindInvalidProjectReferences.cs (5)
87Version.TryParse(TargetPlatformVersion, out Version targetPlatformVersionAsVersion); 99if (ParseMoniker(referencePlatformMoniker, out _, out Version version)) 118private static bool ParseMoniker(string reference, out string platformIdentity, out Version platformVersion) 132parsedVersion = Version.TryParse(rawVersion, out platformVersion);
GetInstalledSDKLocations.cs (2)
154Version platformVersion = Version.Parse(TargetPlatformVersion);
InstalledSDKResolver.cs (1)
27public InstalledSDKResolver(Dictionary<string, ITaskItem> resolvedSDKs, string searchPathElement, GetAssemblyName getAssemblyName, FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, TaskEnvironment taskEnvironment)
LC.cs (2)
193Version targetFramework = Util.GetTargetFrameworkVersion(TargetFrameworkVersion); 211Version targetFramework = Util.GetTargetFrameworkVersion(TargetFrameworkVersion);
ManifestUtil\ApplicationManifest.cs (2)
285Version v; 307Version v = new Version(value);
ManifestUtil\AssemblyIdentity.cs (3)
378Version version = null; 383System.Version.TryParse( 393System.Version.TryParse(frameworkVersion, out version);
ManifestUtil\Constants.cs (1)
15public static readonly Version EntryPointMinimumImageVersion = new Version("2.0.0.0");
ManifestUtil\DeployManifest.cs (4)
265var ver = new Version(version); 266var result = new Version(ver.Major, ver.Minor, ver.Build); 611var v1 = new Version(_minimumRequiredVersion); 612var v2 = new Version(AssemblyIdentity.Version);
ManifestUtil\FileReference.cs (1)
249internal TypeLib(Guid tlbId, Version version, string helpDirectory, int resourceId, int flags)
ManifestUtil\SecurityUtil.cs (2)
72private static readonly Version s_dotNet45Version = new Version("4.5"); 569Version targetVersion = Util.GetTargetFrameworkVersion(targetFrameworkVersion);
ManifestUtil\Util.cs (13)
116Version v = Environment.Version; 139Version clrVersion; 143Version currentVersion = new Version(s_clrVersion4[0], s_clrVersion4[1], s_clrVersion4[2], s_clrVersion4[3]); 147Version frameworkVersion = GetTargetFrameworkVersion(targetFrameworkVersion); 169public static Version GetTargetFrameworkVersion(string targetFramework) 171Version frameworkVersion = null; 176Version.TryParse( 186Version.TryParse(targetFramework, out frameworkVersion); 328Version version; 616public static Version ConvertFrameworkVersionToString(string version) 620return Version.Parse( 633Version version1 = ConvertFrameworkVersionToString(versionA); 634Version version2 = ConvertFrameworkVersionToString(versionB);
RequiresFramework35SP1Assembly.cs (4)
79private static Version ConvertFrameworkVersionToString(string version) 83return Version.Parse( 95Version version1 = ConvertFrameworkVersionToString(versionA); 96Version version2 = ConvertFrameworkVersionToString(versionB);
ResolveManifestFiles.cs (4)
227private static Version ConvertFrameworkVersionToString(string version) 231return Version.Parse( 243Version version1 = ConvertFrameworkVersionToString(versionA); 244Version version2 = ConvertFrameworkVersionToString(versionB);
ResolveSDKReference.cs (15)
81private static readonly Version s_defaultTargetPlatformVersion = new Version("7.0"); 96private Version _targetPlatformVersion; 189if (Version.TryParse(value, out Version versionValue)) 254private Version TargetPlatformAsVersion 592parsedVersion = Version.TryParse(rawSdkVersion, out _); 912public void Resolve(Dictionary<string, ITaskItem> sdks, string targetConfiguration, string targetArchitecture, HashSet<string> sdkNamesOnReferenceItems, bool treatErrorsAsWarnings, bool prefer32Bit, string identifierTargetPlatform, Version versionTargetPlatform, string projectName, bool enableMaxPlatformVersionEmptyWarning) 921System.Version.TryParse(sdk.GetMetadata(SDKPlatformVersion), out Version targetPlatformVersionFromItem); 1171private void CreateResolvedReferenceItem(string targetConfiguration, string targetArchitecture, HashSet<string> sdkNamesOnReferenceItems, string targetPlatformIdentifier, Version targetPlatformVersion, Version targetPlatformVersionFromItem, string projectName, bool enableMaxPlatformVersionEmptyWarning) 1254if (System.Version.TryParse(MaxPlatformVersion, out Version maxPlatformVersionAsVersion) && (maxPlatformVersionAsVersion < targetPlatformVersion)) 1271if (System.Version.TryParse(TargetPlatformMinVersion, out Version targetPlatformMinVersionAsVersion) && (targetPlatformVersion < targetPlatformMinVersionAsVersion))
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (12)
249Version ver = VersionUtilities.ConvertToVersion(osVersion); 291private bool IsVersionInsideRange(Version v, RegistryKey keyPlatform) 298Version minVersion = minVersionAsString == null ? null : VersionUtilities.ConvertToVersion(minVersionAsString); 306Version maxVersion = maxVersionAsString == null ? null : VersionUtilities.ConvertToVersion(maxVersionAsString); 350Version targetVersion = VersionUtilities.ConvertToVersion(targetRuntimeVersion); 365SortedDictionary<Version, List<string>> targetFrameworkVersionToRegistryVersions = new SortedDictionary<Version, List<string>>(ReverseVersionGenericComparer.Comparer); 372Version candidateVersion = VersionUtilities.ConvertToVersion(version); 388Version replacementVersion; 428foreach (KeyValuePair<Version, List<string>> entry in targetFrameworkVersionToRegistryVersions) 456private static void AddCandidateVersion(SortedDictionary<Version, List<string>> targetFrameworkVersionToRegistryVersions, string version, Version candidateVersion)
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (2)
87private static Version GetFrameworkVersion(string version) 89var candidateVersion = VersionUtilities.ConvertToVersion(version);
src\msbuild\src\Shared\ExtensionFoldersRegistryKey.cs (2)
17internal ExtensionFoldersRegistryKey(string registryKey, Version targetFrameworkVersion) 34internal Version TargetFrameworkVersion { get; }
TaskTranslatorHelpers.cs (1)
22Version version = null;
Microsoft.Build.Utilities.Core (106)
AssemblyFolders\AssemblyFoldersExInfo.cs (2)
20public AssemblyFoldersExInfo(RegistryHive hive, RegistryView view, string registryKey, string directoryPath, Version targetFrameworkVersion) 56public Version TargetFrameworkVersion { get; }
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (4)
21/// <param name="targetFrameworkVersion">The <see cref="Version"/> of the target framework.</param> 22public AssemblyFoldersFromConfigInfo(string directoryPath, Version targetFrameworkVersion) 45/// Gets the <see cref="Version"/> of the target framework. 47public Version TargetFrameworkVersion { get; }
ExtensionSDK.cs (10)
30private Version _sdkVersion; 45private Version _minVSVersion; 50private Version _maxPlatformVersion; 64public Version Version 101public Version MinVSVersion 107if (!Version.TryParse(Manifest.MinVSVersion, out _minVSVersion)) 120public Version MaxPlatformVersion 126if (!Version.TryParse(Manifest.MaxPlatformVersion, out _maxPlatformVersion)) 161if (words.Length > 1 && Version.TryParse(words[1], out Version ver))
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (12)
249Version ver = VersionUtilities.ConvertToVersion(osVersion); 291private bool IsVersionInsideRange(Version v, RegistryKey keyPlatform) 298Version minVersion = minVersionAsString == null ? null : VersionUtilities.ConvertToVersion(minVersionAsString); 306Version maxVersion = maxVersionAsString == null ? null : VersionUtilities.ConvertToVersion(maxVersionAsString); 350Version targetVersion = VersionUtilities.ConvertToVersion(targetRuntimeVersion); 365SortedDictionary<Version, List<string>> targetFrameworkVersionToRegistryVersions = new SortedDictionary<Version, List<string>>(ReverseVersionGenericComparer.Comparer); 372Version candidateVersion = VersionUtilities.ConvertToVersion(version); 388Version replacementVersion; 428foreach (KeyValuePair<Version, List<string>> entry in targetFrameworkVersionToRegistryVersions) 456private static void AddCandidateVersion(SortedDictionary<Version, List<string>> targetFrameworkVersionToRegistryVersions, string version, Version candidateVersion)
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (2)
87private static Version GetFrameworkVersion(string version) 89var candidateVersion = VersionUtilities.ConvertToVersion(version);
src\msbuild\src\Shared\ExtensionFoldersRegistryKey.cs (2)
17internal ExtensionFoldersRegistryKey(string registryKey, Version targetFrameworkVersion) 34internal Version TargetFrameworkVersion { get; }
TargetPlatformSDK.cs (8)
33private Version _minVSVersion; 38private Version _minOSVersion; 43public TargetPlatformSDK(string targetPlatformIdentifier, Version targetPlatformVersion, string path) 57public Version MinVSVersion 63if (!Version.TryParse(Manifest.MinVSVersion, out _minVSVersion)) 76public Version MinOSVersion 82if (!Version.TryParse(Manifest.MinOSVersion, out _minOSVersion)) 100public Version TargetPlatformVersion { get; }
ToolLocationHelper.cs (66)
377public static IDictionary<string, string> GetPlatformExtensionSDKLocations(string targetPlatformIdentifier, Version targetPlatformVersion) 389public static IDictionary<string, string> GetPlatformExtensionSDKLocations(string[] diskRoots, string registryRoot, string targetPlatformIdentifier, Version targetPlatformVersion) 402public static IDictionary<string, string> GetPlatformExtensionSDKLocations(string[] diskRoots, string[] extensionDiskRoots, string registryRoot, string targetPlatformIdentifier, Version targetPlatformVersion) 423public static IDictionary<string, Tuple<string, string>> GetPlatformExtensionSDKLocationsAndVersions(string targetPlatformIdentifier, Version targetPlatformVersion) 435public static IDictionary<string, Tuple<string, string>> GetPlatformExtensionSDKLocationsAndVersions(string[] diskRoots, string registryRoot, string targetPlatformIdentifier, Version targetPlatformVersion) 448public static IDictionary<string, Tuple<string, string>> GetPlatformExtensionSDKLocationsAndVersions(string[] diskRoots, string[] multiPlatformDiskRoots, string registryRoot, string targetPlatformIdentifier, Version targetPlatformVersion) 466private static IEnumerable<TargetPlatformSDK> GetTargetPlatformMonikers(string[] diskRoots, string[] extensionDiskRoots, string registryRoot, string targetPlatformIdentifier, Version targetPlatformVersion) 483.OrderBy<TargetPlatformSDK, Version>(platform => platform.TargetPlatformVersion); 495public static string GetPlatformExtensionSDKLocation(string sdkMoniker, string targetPlatformIdentifier, Version targetPlatformVersion) 509public static string GetPlatformExtensionSDKLocation(string sdkMoniker, string targetPlatformIdentifier, Version targetPlatformVersion, string[] diskRoots, string registryRoot) 524public static string GetPlatformExtensionSDKLocation(string sdkMoniker, string targetPlatformIdentifier, Version targetPlatformVersion, string[] diskRoots, string[] extensionDiskRoots, string registryRoot) 539.OrderByDescending<TargetPlatformSDK, Version>(platform => platform.TargetPlatformVersion) 606if (Version.TryParse(targetPlatformVersion, out Version platformVersion)) 622public static IDictionary<string, string> FilterPlatformExtensionSDKs(Version targetPlatformVersion, IDictionary<string, string> extensionSdks) 787public static IList<TargetPlatformSDK> FilterTargetPlatformSdks(IList<TargetPlatformSDK> targetPlatformSdkList, Version osVersion, Version vsVersion) 1251public static string GetPlatformSDKLocation(string targetPlatformIdentifier, Version targetPlatformVersion) 1263public static string GetPlatformSDKLocation(string targetPlatformIdentifier, Version targetPlatformVersion, string[] diskRoots, string registryRoot) 1299if (Version.TryParse(targetPlatformVersion, out Version platformVersion)) 1327public static IEnumerable<string> GetPlatformsForSDK(string sdkIdentifier, Version sdkVersion) => GetPlatformsForSDK(sdkIdentifier, sdkVersion, null, null); 1337public static IEnumerable<string> GetPlatformsForSDK(string sdkIdentifier, Version sdkVersion, string[] diskRoots, string registryRoot) 1381var availablePlatformVersions = new List<Version>(); 1384Version platformVersion; 1410public static IEnumerable<string> GetFoldersInVSInstalls(Version minVersion = null, Version maxVersion = null, string subFolder = null) 1454Version minVersion, maxVersion; 1456if (string.IsNullOrEmpty(minVersionString) || !Version.TryParse(minVersionString, out minVersion)) 1460if (string.IsNullOrEmpty(maxVersionString) || !Version.TryParse(maxVersionString, out maxVersion)) 1532private static bool TryParsePlatformVersion(string platformMoniker, out Version platformVersion) 1576if (Version.TryParse(targetPlatformVersion, out Version platformVersion)) 1588private static TargetPlatformSDK GetMatchingPlatformSDK(string targetPlatformIdentifier, Version targetPlatformVersion, string[] diskRoots, string[] multiPlatformDiskRoots, string registryRoot) 1660var dotNetFrameworkVersion = TargetDotNetFrameworkVersionToSystemVersion(version); 1661var vsVersion = VisualStudioVersionToSystemVersion(visualStudioVersion); 1681var dotNetFrameworkVersion = TargetDotNetFrameworkVersionToSystemVersion(version); 1682var vsVersion = VisualStudioVersionToSystemVersion(visualStudioVersion); 1701Version frameworkVersion = TargetDotNetFrameworkVersionToSystemVersion(version); 1733var dotNetFrameworkVersion = TargetDotNetFrameworkVersionToSystemVersion(version); 1734var vsVersion = VisualStudioVersionToSystemVersion(visualStudioVersion); 1819Version frameworkVersion = ConvertTargetFrameworkVersionToVersion(targetFrameworkVersion); 1923Version frameworkVersion = ConvertTargetFrameworkVersionToVersion(targetFrameworkVersion); 2001var dotNetFrameworkVersion = TargetDotNetFrameworkVersionToSystemVersion(version); 2002var vsVersion = VisualStudioVersionToSystemVersion(visualStudioVersion); 2006private static Version TargetDotNetFrameworkVersionToSystemVersion(TargetDotNetFrameworkVersion version) 2065private static Version VisualStudioVersionToSystemVersion(VisualStudioVersion version) 2080Version Unsupported() 2543if (Version.TryParse(sdkVersionDirectory.Name, out Version _)) 2606SortedDictionary<Version, List<string>> versionsInRoot = VersionUtilities.GatherVersionStrings(null, rootPathWithIdentifier.GetDirectories().Select<DirectoryInfo, string>(directory => directory.Name)); 2611foreach (KeyValuePair<Version, List<string>> directoryUnderRoot in versionsInRoot) 2715SortedDictionary<Version, List<string>> sortedVersions = VersionUtilities.GatherVersionStrings(null, versions); 2717foreach (KeyValuePair<Version, List<string>> registryVersions in sortedVersions) 2807Version tempVersion; 2808if (Version.TryParse(sdkVersion, out tempVersion)) 3046Version tempVersion; 3047if (Version.TryParse(platformVersion.Name, out tempVersion)) 3648Version version = VersionUtilities.ConvertToVersion(frameworkVersion); 3693Version targetFrameworkVersion = ConvertTargetFrameworkVersionToVersion(frameworkVersions[frameworkVersions.Count - 1]); 3744private static Version ConvertTargetFrameworkVersionToVersion(string targetFrameworkVersion) 3750return Version.Parse(targetFrameworkVersion.AsSpan(1)); 3872if (Version.TryParse( 3928Version ver = VersionUtilities.ConvertToVersion(frameworkVersion); 4001return Version.Parse(versionX.AsSpan(1)).CompareTo(Version.Parse(versionY.AsSpan(1)));
Microsoft.CodeAnalysis (53)
CommandLine\CommonCompiler.cs (2)
187internal Version? GetAssemblyVersion() 728Version assemblyVersion = GetAssemblyVersion() ?? new Version();
CommandLine\SarifV1ErrorLogger.cs (1)
31public SarifV1ErrorLogger(Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion, CultureInfo culture)
CommandLine\SarifV2ErrorLogger.cs (2)
31private readonly Version _toolAssemblyVersion; 35public SarifV2ErrorLogger(Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion, CultureInfo culture)
Compilation\DeterministicKeyBuilder.cs (1)
80protected static void WriteVersion(JsonWriter writer, string key, Version version)
CvtRes.cs (5)
505Version assemblyVersion, //individual values must be smaller than 65535 585private readonly Version _assemblyVersionContents; 599Version assemblyVersion) 644Version fileVersion; 647Version productVersion;
Desktop\AssemblyVersion.cs (3)
104/// Converts <see cref="Version"/> to <see cref="AssemblyVersion"/>. 107public static explicit operator AssemblyVersion(Version version) 112public static explicit operator Version(AssemblyVersion version)
Desktop\DesktopAssemblyIdentityComparer.cs (4)
234(Version)value.NewVersion, 252Version? newVersion = null; 265newVersion = (Version)s_VER_ASSEMBLYVERSION_STR_L; 282newVersion = (Version)s_VER_ASSEMBLYVERSION_STR_L;
DiagnosticAnalyzer\AnalyzerLoadFailureEventArgs.cs (1)
44public Version? ReferencedCompilerVersion { get; internal init; }
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
424var versionPattern = reference.AssemblyVersionPattern;
Emit\ErrorType.cs (1)
226Version Cci.IAssemblyReference.AssemblyVersionPattern => null;
MetadataReader\MetadataReaderExtensions.cs (1)
96Version version,
MetadataReference\AssemblyIdentity.cs (9)
33private readonly Version _version; 57private AssemblyIdentity(AssemblyIdentity other, Version version) 74internal AssemblyIdentity WithVersion(Version version) => (version == _version) ? this : new AssemblyIdentity(this, version); 99Version? version = null, 158Version version, 181Version? version = null, 247internal static readonly Version NullVersion = new Version(0, 0, 0, 0); 249private static bool IsValid(Version? value) 275public Version Version { get { return _version; } }
MetadataReference\AssemblyIdentity.DisplayName.cs (2)
237Version? version = null; 583internal static Version ToVersion(ulong version)
MetadataReference\AssemblyIdentityMap.cs (2)
77public bool TryGetValue(AssemblyIdentity identity, out TValue value, Func<Version, Version, TValue, bool> comparer)
MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
NativePdbWriter\PdbWriter.cs (2)
791var fileVersion = Version.Parse(compilerAssembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version);
PEWriter\Units.cs (1)
23Version? AssemblyVersionPattern { get; }
ReferenceManager\CommonReferenceManager.Resolution.cs (2)
929Version? minHigherVersionDefinitionVersion = null; 931Version? maxLowerVersionDefinitionVersion = null;
ReferenceManager\CommonReferenceManager.State.cs (4)
550var versionPattern = symbols[i].AssemblyVersionPattern; 579internal static bool CompareVersionPartsSpecifiedInSource(Version version, Version candidateVersion, TAssemblySymbol candidateSymbol) 589var versionPattern = candidateSymbol.AssemblyVersionPattern;
Symbols\Attributes\CommonAssemblyWellKnownAttributeData.cs (2)
93private Version _assemblyVersionAttributeSetting; 99public Version AssemblyVersionAttributeSetting
Symbols\IAssemblySymbolInternal.cs (1)
13Version? AssemblyVersionPattern { get; }
VersionHelper.cs (5)
19internal static bool TryParse(string s, out Version version) 35internal static bool TryParseAssemblyVersion(string s, bool allowWildcard, out Version version) 53private static bool TryParse(string s, bool allowWildcard, ushort maxValue, bool allowPartialParse, out Version version) 170public static Version? GenerateVersionFromPatternAndCurrentTime(DateTime time, Version pattern)
Microsoft.CodeAnalysis.Analyzers (28)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (3)
190void OnDuplicateEntryInRelease(string ruleId, Version currentVersion, string path, SourceText sourceText, TextLine line) 387[NotNullWhen(returnValue: true)] out Version? version, 415using var _ = PooledDictionary<string, (Version version, ReleaseTrackingLine releaseTrackingLine)>.GetInstance(out var lastEntriesByRuleMap);
MetaAnalyzers\ReleaseTrackingHelper.cs (23)
42internal static Version UnshippedVersion { get; } = new Version(int.MaxValue, int.MaxValue); 47Action<string, Version, string, SourceText, TextLine> onDuplicateEntryInRelease, 52var currentVersion = UnshippedVersion; 55using var _ = PooledHashSet<Version>.GetInstance(out var versionsBuilder); 78if (!Version.TryParse(versionString, out var version)) 338public ImmutableHashSet<Version> Versions { get; } 341: this(ImmutableSortedDictionary<string, ReleaseTrackingDataForRule>.Empty, ImmutableHashSet<Version>.Empty) 345internal ReleaseTrackingData(ImmutableSortedDictionary<string, ReleaseTrackingDataForRule> releaseTrackingDataByRuleIdMap, ImmutableHashSet<Version> versions) 353[NotNullWhen(returnValue: true)] out Version? version, 359Version maxVersion, 360[NotNullWhen(returnValue: true)] out Version? version, 366Version? maxVersion, 367[NotNullWhen(returnValue: true)] out Version? version, 397public ImmutableSortedDictionary<Version, ReleaseTrackingLine> ReleasesByVersionMap { get; } 408private readonly ImmutableSortedDictionary<Version, ReleaseTrackingLine>.Builder _builder 409= ImmutableSortedDictionary.CreateBuilder<Version, ReleaseTrackingLine>(ReverseComparer.Instance); 411public void AddEntry(Version version, ReleaseTrackingLine releaseTrackingLine, out bool hasExistingEntry) 417public ImmutableSortedDictionary<Version, ReleaseTrackingLine> ToImmutable() 420private sealed class ReverseComparer : IComparer<Version> 422public static readonly IComparer<Version> Instance = new ReverseComparer(); 425public int Compare([AllowNull] Version x, [AllowNull] Version y)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
36var assemblyVersion = thisAssemblyName.Version;
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
36var assemblyVersion = thisAssemblyName.Version;
Microsoft.CodeAnalysis.CSharp (15)
Emitter\Model\AssemblyReference.cs (1)
30public Version AssemblyVersionPattern => _targetAssembly.AssemblyVersionPattern;
Emitter\Model\PEAssemblyBuilder.cs (1)
206public Version AssemblyVersionPattern => _sourceAssembly.AssemblyVersionPattern;
Symbols\AssemblySymbol.cs (1)
107public abstract Version AssemblyVersionPattern { get; }
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
108public override Version AssemblyVersionPattern => null;
Symbols\MissingAssemblySymbol.cs (1)
68public override Version AssemblyVersionPattern => null;
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
154public override Version AssemblyVersionPattern => _underlyingAssembly.AssemblyVersionPattern;
Symbols\Source\SourceAssemblySymbol.cs (9)
385private Version AssemblyVersionAttributeSetting 389var defaultValue = (Version)null; 390var fieldValue = defaultValue; 411public override Version AssemblyVersionPattern 415var attributeValue = AssemblyVersionAttributeSetting; 2421Version version; 2433Version dummy; 2484Version dummy;
Microsoft.CodeAnalysis.Features (2)
FindUsages\AssemblyLocation.cs (1)
16[property: DataMember(Order = 1)] Version Version,
SemanticSearch\SemanticSearchCopilotContext.cs (1)
20public required IEnumerable<(string name, Version version)> AvailablePackages { get; init; }
Microsoft.CodeAnalysis.Razor.Compiler (1)
Mvc\ViewComponentTypes.cs (1)
14public static readonly Version AssemblyVersion = new Version(1, 1, 0, 0);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
Microsoft.CodeAnalysis.Scripting (7)
Hosting\AssemblyLoader\InteractiveAssemblyLoader.cs (1)
453Version? candidateVersion = null;
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (4)
209internal static unsafe Version GetVersion(IAssemblyName nameObject) 222internal static Version GetVersion(IAssemblyName name, out AssemblyIdentityParts parts) 526Version bestVersion = null; 532Version candidateVersion = GetVersion(candidate);
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\MonoGlobalAssemblyCache.cs (2)
40private static IEnumerable<string> GetGacAssemblyPaths(string gacPath, string name, Version version, byte[] publicKeyTokenBytes) 106private static IEnumerable<(AssemblyIdentity Identity, string Path)> GetAssemblyIdentitiesAndPaths(string name, Version version, byte[] publicKeyToken, ImmutableArray<ProcessorArchitecture> architectureFilter)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MissingAssemblySymbol.vb (1)
58Public Overrides ReadOnly Property AssemblyVersionPattern As Version
Microsoft.CodeAnalysis.Workspaces (6)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
36var assemblyVersion = thisAssemblyName.Version;
Utilities\Versions.cs (1)
11public static readonly Version Null = new(0, 0, 0, 0);
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (2)
94var generatorAssemblyVersion = Version.Parse(reader.ReadRequiredString());
Workspace\Solution\SourceGeneratorIdentity.cs (1)
26[property: DataMember(Order = 2)] Version AssemblyVersion,
Microsoft.Deployment.DotNet.Releases (5)
AspNetCoreReleaseComponent.cs (5)
19public ReadOnlyCollection<Version> AspNetCoreModuleVersions 45List<Version> ancmVersions = new(); 53if (System.Version.TryParse(enumerator.Current.GetString(), out Version version)) 60AspNetCoreModuleVersions = new ReadOnlyCollection<Version>(ancmVersions);
Microsoft.Diagnostics.DataContractReader.Legacy (2)
MetaDataImportImpl.cs (2)
1690System.Version version = assemblyDef.Version; 1791System.Version version = assemblyRef.Version;
Microsoft.Diagnostics.NETCore.Client (2)
DiagnosticsIpc\ProcessInfo.cs (2)
101internal bool TryGetProcessClrVersion(out Version version, out bool isPrerelease) 128return Version.TryParse(noMetadataVersion.Slice(0, prereleaseIndex).ToString(), out version);
Microsoft.DiaSymReader (1)
Extensions\SymUnmanagedExtensions.Reader.cs (1)
179public static bool TryGetCompilerInfo(this ISymUnmanagedCompilerInfoReader reader, out Version version, out string name)
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RoslynResolver.cs (1)
51Version? resolvedVersion = asm.GetName().Version;
Microsoft.DotNet.ApiCompatibility (2)
Rules\AssemblyIdentityMustMatch.cs (2)
77Version leftAssemblyVersion = leftIdentity.Version; 82Version rightAssemblyVersion = rightIdentity.Version;
Microsoft.DotNet.Arcade.Sdk (2)
src\CalculateAssemblyAndFileVersions.cs (2)
44if (!Version.TryParse(VersionPrefix, out var prefix) ||
Microsoft.DotNet.Build.Tasks.Packaging (153)
ApplyBaseLine.cs (11)
61Dictionary<string, SortedSet<Version>> baseLineVersions = new Dictionary<string, SortedSet<Version>>(); 64SortedSet<Version> versions = null; 67baseLineVersions[baseLinePackage.ItemSpec] = versions = new SortedSet<Version>(); 78SortedSet<Version> dependencyBaseLineVersions = null; 79Version requestedVersion = null; 80Version.TryParse(dependency.GetMetadata("Version"), out requestedVersion); 86Version baseLineVersion = requestedVersion == null ? 111Version assemblyVersion = null, packageVersion = null, baseLineVersion = null; 113Version.TryParse(dependency.GetMetadata("Version"), out packageVersion); 114Version.TryParse(dependency.GetMetadata("AssemblyVersion"), out assemblyVersion);
ApplyPreReleaseSuffix.cs (9)
18private Dictionary<string, Version> _stablePackageVersions; 94Version packageVersion = ParseAs3PartVersion(packageVersionString); 118_stablePackageVersions = new Dictionary<string, Version>(); 123Version newVersion = ParseAs3PartVersion(stablePackage.GetMetadata("Version")); 124Version existingVersion = null; 135private bool IsStable(string packageId, Version packageVersion) 141Version stableVersion; 164private static Version ParseAs3PartVersion(string versionString) 166Version result = new Version(versionString);
CreateTrimDependencyGroups.cs (2)
196private static Version GetAssemblyVersion(ITaskItem dependency) 210public Version AssemblyVersion { get; }
FrameworkUtilities.cs (3)
42public static Version Ensure4PartVersion(string versionString) 58public static Version Ensure4PartVersion(Version version)
GenerateNuSpec.cs (2)
361var version = PackageType.EmptyVersion; 365System.Version.TryParse(versionString, out version);
GetLastStablePackage.cs (11)
75Dictionary<string, Version> latestPackages = new Dictionary<string, Version>(); 76Dictionary<string, Version> lastStablePackages = new Dictionary<string, Version>(); 97Version latestVersion; 104Version stableVersion; 105if (versionString == null || !Version.TryParse(versionString, out stableVersion)) 118Version lastStableVersion; 145var latestVersion = (DoNotAllowVersionsFromSameRelease) ? VersionUtility.As2PartVersion(nuGetVersion?.Version) : nuGetVersion?.Version; 150IEnumerable<Version> candidateVersions = (latestVersion == null) ? info.StableVersions : info.StableVersions.Where(sv => VersionUtility.As4PartVersion(sv) < latestVersion); 162private ITaskItem CreateItem(ITaskItem originalItem, Version version)
HarvestPackage.cs (2)
298var preserveRefVersion = new HashSet<Version>(desktopLibVersions); 344var assemblyVersion = extension == s_dll ? VersionUtility.GetAssemblyVersion(packageFile) : null;
NuGetUtility.cs (6)
22internal static IEnumerable<Version> GetAllVersionsForPackageId(string packageId, bool includePrerelease, bool includeUnlisted, Log log, CancellationToken cancellationToken) 24List<Version> result = new List<Version>(); 62Version threePartVersion = VersionUtility.As3PartVersion(packageMetadata.Identity.Version.Version); 84public static Version GetLatestPatchStableVersionForRelease(this IEnumerable<Version> versions, int eraMajorVersion, int eraMinorVersion)
PackageIndex.cs (62)
195var assemblyVersion = VersionUtility.GetAssemblyVersion(file); 221Version supportedVersion = (versionAttribute != null) ? new Version(versionAttribute.Value) : VersionUtility.MaxVersion; 227private void TryAddInbox(string assemblyName, NuGetFramework framework, Version version, bool addPackages = true) 242public bool TryGetBaseLineVersion(string packageId, out Version baseLineVersion) 276Version assemblyVersion = FrameworkUtilities.Ensure4PartVersion(assemblyVersionString); 281public IEnumerable<NuGetFramework> GetInboxFrameworks(string assemblyName, Version assemblyVersion) 296Version assemblyVersion = FrameworkUtilities.Ensure4PartVersion(assemblyVersionString); 301public bool IsInbox(string assemblyName, NuGetFramework framework, Version assemblyVersion) 314public bool IsStable(string packageId, Version packageVersion) 345public Version GetPackageVersionForAssemblyVersion(string packageId, Version assemblyVersion) 348Version packageVersion = null; 369public HashSet<Version> StableVersions { get; set; } = new HashSet<Version>(); 376public Version BaselineVersion { get; set; } 388public SortedDictionary<Version, Version> AssemblyVersionInPackageVersion { get; set; } = new SortedDictionary<Version, Version>(); 415Version otherAssemblyVersion = assemblyVersionInPackage.Key; 416Version otherPackageVersion = assemblyVersionInPackage.Value; 422public void AddAssemblyVersionsInPackage(IEnumerable<Version> assemblyVersions, Version packageVersion) 424foreach (var assemblyVersion in assemblyVersions) 430public void AddAssemblyVersionInPackage(Version assemblyVersion, Version packageVersion) 432Version existingPackageVersion; 453public Version GetPackageVersionForAssemblyVersion(NuGetFramework framework, Version assemblyVersion) 455Version packageVersion = null; 470public Version GetPackageVersionForAssemblyVersion(Version assemblyVersion) 472Version packageVersion = null; 490private SortedDictionary<string, SortedDictionary<Version, Version>> inboxVersions = new SortedDictionary<string, SortedDictionary<Version, Version>>(); 494public void AddInboxVersion(NuGetFramework framework, Version assemblyVersion) 498var frameworkVersion = normalizedFramework.Version; 500SortedDictionary<Version, Version> mappings; 503inboxVersions[frameworkKey] = mappings = new SortedDictionary<Version, Version>(); 513List<Version> redundantMappings = new List<Version>(); 518var existingFrameworkVersion = mapping.Key; 519var existingAssemblyVersion = mapping.Value; 544foreach(var redundantMapping in redundantMappings) 557foreach (var frameworkVersion in framework.Value.Keys) 566public IEnumerable<KeyValuePair<NuGetFramework, Version>> GetInboxVersions() 572var frameworkVersion = frameworkInboxVersionPair.Key; 573var assemblyVersion = frameworkInboxVersionPair.Value; 577yield return new KeyValuePair<NuGetFramework, Version>(fx, assemblyVersion); 587SortedDictionary<Version, Version> mappings; 597public bool IsInbox(NuGetFramework framework, Version assemblyVersion, bool permitRevisions = false) 602SortedDictionary<Version, Version> mappings; 609Version assemblyVersionInbox; 678private static NuGetFramework FromFrameworkKeyAndVersion(string key, Version version) 709var version = versionString.Equals(AnyVersion, StringComparison.OrdinalIgnoreCase) ? VersionUtility.MaxVersion : new Version(versionString); 729var assemblyVersion = frameworkPair.Value;
PackageItem.cs (3)
62private Version _version; 63public Version Version 73Version.TryParse(versionString, out _version);
PackageReport.cs (1)
138public Version Version { get; set; }
SplitReferences.cs (4)
105Version existingVersion = Version.Parse(existingItem.GetMetadata("Version")); 106Version newVersion = Version.Parse(existingItem.GetMetadata("Version"));
UpdatePackageIndex.cs (10)
138info.BaselineVersion = Version.Parse(version); 149info.StableVersions.Add(Version.Parse(version)); 182var maxVersion = packageInfo.StableVersions.Max(); 192IEnumerable<Version> stablePackageVersions = NuGetUtility.GetAllVersionsForPackageId(package.Key, includePrerelease: false, includeUnlisted: false, Log, CancellationToken.None); 230IEnumerable<Version> assemblyVersions; 263private void UpdateFromValues(PackageIndex index, string id, NuGetVersion version, IEnumerable<Version> assemblyVersions, IEnumerable<string> dllNames) 271IEnumerable<Version> allStableVersions = NuGetUtility.GetAllVersionsForPackageId(id, includePrerelease: false, includeUnlisted: false, Log, CancellationToken.None); 280var packageVersion = VersionUtility.As3PartVersion(version.Version); 287var assmVersions = new HashSet<Version>(assemblyVersions.NullAsEmpty().Where(v => v != null)); 322foreach (var orphanedAssemblyVersion in orphanedAssemblyVersions.ToArray())
ValidateHarvestVersionIsLatestForRelease.cs (2)
137IEnumerable<Version> packageVersions = NuGetUtility.GetAllVersionsForPackageId(packageId, includePrerelease: false, includeUnlisted: false, Log, CancellationToken.None); 138Version latestPatchVersion = packageVersions.GetLatestPatchStableVersionForRelease(releaseMajorVersion, releaseMinorVersion);
ValidatePackage.cs (13)
156Version minSupportedGeneration = allRuntimeGenerations.Concat(allSupportedGenerations).Min(); 177Version supportedVersion = validateFramework.SupportedVersion; 250Version referenceAssemblyVersion = null; 305Version implementationVersion = implementationAssembly.Version; 389var assemblyVersions = new HashSet<Version>(allAssemblies.Select(f => VersionUtility.As4PartVersion(f.Version))); 391var thisPackageVersion = VersionUtility.As3PartVersion(NuGetVersion.Parse(PackageVersion).Version); 393foreach (var fileVersion in assemblyVersions) 395Version packageVersion; 523Version supportedVersion; 527supportedVersion = Version.Parse(version); 623Version supportedVersion; 624if (!Version.TryParse(supportedFramework.Value, out supportedVersion)) 652public Version SupportedVersion { get; set; }
VersionUtility.cs (12)
13public static readonly Version MaxVersion = new Version(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue); 15public static bool IsCompatibleApiVersion(Version referenceVersion, Version definitionVersion) 24public static Version GetAssemblyVersion(string assemblyPath) 32public static Version GetAssemblyVersion(Stream assemblyStream) 34Version result = null; 57public static Version As3PartVersion(Version version) 78public static Version As2PartVersion(Version version) 91public static Version As4PartVersion(Version version)
Microsoft.DotNet.Build.Tasks.Workloads (19)
Swix\SwixComponent.cs (5)
28private static readonly Version s_v1 = new Version("1.0.0.0"); 100internal SwixComponent(ReleaseVersion sdkFeatureBand, string name, string title, string description, Version version, 118public void AddDependency(string id, Version? minVersion = null, Version? maxVersion = null) 162Version componentVersion = resourceItem != null && !string.IsNullOrWhiteSpace(resourceItem.GetMetadata(Metadata.Version)) ?
Swix\SwixDependency.cs (5)
26public Version? MinVersion 34public Version? MaxVersion 44public SwixDependency(string id, Version version) : this(id, version, version) 56public SwixDependency(string id, Version? minVersion, Version? maxVersion)
Swix\SwixPackageBase.cs (2)
32public Version Version 42public SwixPackageBase(string name, Version version)
Swix\SwixProjectBase.cs (2)
43public Version Version 59public SwixProjectBase(string id, Version version, string baseIntermediateOutputPath, string baseOutputPath, bool outOfSupport = false) :
WorkloadPackageBase.cs (5)
94public abstract Version MsiVersion 166/// A <see cref="System.Version"/> containing the major, minor, and patch version of the underlying NuGet package. 168public Version Version => Identity.Version.Version; 320internal static Version GetMsiVersion(ITaskItem package, Version msiVersion, string taskName,
Microsoft.DotNet.GenFacades (1)
RoslynBuildTask.cs (1)
46Version resolvedVersion = asm.GetName().Version;
Microsoft.DotNet.HotReload.Watch (16)
AppModels\WebApplicationAppModel.cs (2)
14private static readonly Version s_minimumSupportedVersion = Versions.Version6_0; 42var targetFramework = clientProject.GetTargetFrameworkVersion() ?? throw new InvalidOperationException($"Project doesn't define {PropertyNames.TargetFrameworkMoniker}");
Build\ProjectGraphFactory.cs (1)
46var version = new FrameworkName(attribute.FrameworkName).Version;
Build\ProjectGraphUtilities.cs (3)
28public static Version? GetTargetFrameworkVersion(this ProjectGraphNode projectNode) 43public static bool IsTargetFrameworkVersionOrNewer(this ProjectGraphNode projectNode, Version minVersion) 52public static bool IsNetCoreApp(this ProjectGraphNode projectNode, Version minVersion)
src\sdk\src\Dotnet.Watch\HotReloadClient\Logging\LogEvents.cs (2)
81public static readonly LogEvent<(Version, string)> UsingCapabilitiesBasedOnTargetFrameworkVersion = Create<(Version, string)>(LogLevel.Debug, "Using capabilities based on project target framework version: '{0}': {1}.");
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\WebAssemblyHotReloadClient.cs (2)
23Version projectTargetFrameworkVersion, 42private static ImmutableArray<string> GetUpdateCapabilities(ILogger logger, ImmutableArray<string> projectHotReloadCapabilities, Version projectTargetFrameworkVersion)
UI\IReporter.cs (3)
213public static readonly MessageDescriptor<(Version, string)> UsingCapabilitiesBasedOnTargetFrameworkVersion = Create(LogEvents.UsingCapabilitiesBasedOnTargetFrameworkVersion, Emoji.HotReload); 267public static readonly MessageDescriptor<Version> ProjectDoesNotSupportHotReload_TargetFramework = Create<Version>("Project does not support Hot Reload: Target Framework is older than {0}. Application will be restarted when updated.", Emoji.Warning, LogLevel.Warning);
Utilities\Versions.cs (3)
8public static readonly Version Version3_1 = new(3, 1); 9public static readonly Version Version6_0 = new(6, 0); 10public static readonly Version Version11_0 = new(11, 0);
Microsoft.DotNet.PackageTesting (11)
VerifyClosure.cs (11)
43private Dictionary<string, Version> ignoredReferences = new Dictionary<string, Version>(StringComparer.OrdinalIgnoreCase); 135Version version = null; 139version = Version.Parse(versionString); 142Version existingVersion; 159Version toIgnore; 410public AssemblyInfo(string path, string name, Version version, AssemblyReference[] references, string[] moduleReferences) 422public Version Version { get; } 439var version = assembly.Version; 488public AssemblyReference(string name, Version version) 495public Version Version { get; }
Microsoft.DotNet.SdkResolver (9)
NETCoreSdkResolver.cs (9)
18private static readonly ConcurrentDictionary<string, Version> s_minimumMSBuildVersions 38public readonly Version MSBuildVersion; 40public CompatibleSdkKey(string? dotnetExeDirectory, Version msbuildVersion) 78private string? GetMostCompatibleSdk(string? dotnetExeDirectory, Version msbuildVersion, int minimumSdkMajorVersion = 0) 89private CompatibleSdkValue GetMostCompatibleSdks(string? dotnetExeDirectory, Version msbuildVersion, int minimumSdkMajorVersion) 103Version minimumMSBuildVersion = GetMinimumMSBuildVersion(netcoreSdkDir); 131public Version GetMinimumMSBuildVersion(string netcoreSdkDir) 146return Version.Parse(File.ReadLines(minimumVersionFilePath).First().Trim()); 150public SdkResolutionResult ResolveNETCoreSdkDirectory(string? globalJsonStartDir, Version msbuildVersion, bool isRunningInVisualStudio, string? dotnetExeDir)
Microsoft.DotNet.SharedFramework.Sdk (20)
src\arcade\src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (11)
43private Dictionary<string, Version> ignoredReferences = new Dictionary<string, Version>(StringComparer.OrdinalIgnoreCase); 135Version version = null; 139version = Version.Parse(versionString); 142Version existingVersion; 159Version toIgnore; 410public AssemblyInfo(string path, string name, Version version, AssemblyReference[] references, string[] moduleReferences) 422public Version Version { get; } 439var version = assembly.Version; 488public AssemblyReference(string name, Version version) 495public Version Version { get; }
src\FileUtilities.cs (2)
20public static Version GetFileVersion(string sourcePath) 63public Version Version { get; set; }
src\GenerateSharedFrameworkDepsFile.cs (1)
64Version assemblyVersion = FileUtilities.GetAssemblyName(filePath)?.Version;
src\ValidateFileVersions.cs (6)
15private static readonly Version ZeroVersion = new Version(0, 0, 0, 0); 108Version assemblyVersion, fileVersion; 110Version.TryParse(file.GetMetadata("AssemblyVersion"), out assemblyVersion); 111Version.TryParse(file.GetMetadata("FileVersion"), out fileVersion); 131public Version AssemblyVersion { get; set; } 132public Version FileVersion { get; set; }
Microsoft.DotNet.TemplateLocator (13)
src\sdk\src\Common\EnvironmentVariableNames.cs (6)
61private static readonly Version s_version6_0 = new(6, 0); 66public static string? TryGetDotNetRootVariableName(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion) 69internal static string? TryGetDotNetRootVariableNameImpl(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion, Architecture currentArchitecture, bool is64bit, bool onlyUseArchSpecific = false) 108public static Version? TryParseTargetFrameworkVersion(string targetFrameworkVersion) 111return !string.IsNullOrEmpty(targetFrameworkVersion) && Version.TryParse(targetFrameworkVersion.Substring(1), out var version) ? version : null;
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
31if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
TemplateLocator.cs (3)
69if (!Version.TryParse(vsVersion, out var parsedVsVersion)) 76var msbuildMajorMinorVersion = new Version(parsedVsVersion.Major, parsedVsVersion.Minor, 0);
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
100yield return new TestData<Version>(new(1, 2, 3, 4), """{"$comment":"Represents a version string.", "type":["string","null"],"pattern":"^\\d+(\\.\\d+){1,3}$"}"""); 1244[JsonSerializable(typeof(Version))]
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
22private Version? _version;
Microsoft.Extensions.Identity.Core (5)
IdentitySchemaVersions.cs (4)
16public static readonly Version Default = new Version(0, 0); 21public static readonly Version Version1 = new Version(1, 0); 26public static readonly Version Version2 = new Version(2, 0); 31public static readonly Version Version3 = new Version(3, 0);
StoreOptions.cs (1)
29public Version SchemaVersion { get; set; } = IdentitySchemaVersions.Default;
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
19public Version? P4 { get; set; }
Microsoft.Maui.Essentials (9)
AppInfo\AppInfo.netstandard.cs (1)
9 public System.Version Version => Utils.ParseVersion(VersionString);
AppInfo\AppInfo.shared.cs (2)
30 Version Version { get; } 84 public static Version Version => Current.Version;
DeviceInfo\DeviceInfo.netstandard.cs (1)
16 public Version Version => throw ExceptionUtils.NotSupportedOrImplementedException;
DeviceInfo\DeviceInfo.shared.cs (2)
50 Version Version { get; } 97 public static Version Version => Current.Version;
Types\Shared\Utils.shared.cs (3)
10 internal static Version ParseVersion(string version) 12 if (Version.TryParse(version, out var number))
Microsoft.ML.TestFrameworkCommon (3)
Attributes\AttributeHelpers.cs (3)
12public static bool CheckLibcVersionGreaterThanMinimum(Version minVersion) 15Version version; 23version = Version.Parse(Marshal.PtrToStringUTF8(gnu_get_libc_version()));
Microsoft.NET.Build.Tasks (82)
CreateWindowsSdkKnownFrameworkReferences.cs (10)
62var tpv = new Version(TargetPlatformVersion); 70var normalizedTargetFrameworkVersion = ProcessFrameworkReferences.NormalizeVersion(new Version(TargetFrameworkVersion)); 72var knownFrameworkReferencesByWindowsSdkVersion = new Dictionary<Version, List<(Version minimumNetVersion, TaskItem[] knownFrameworkReferences)>>(); 81Version normalizedMinimumVersion = new(0, 0, 0); 91if (!Version.TryParse(supportedWindowsVersion.ItemSpec, out var windowsSdkVersionParsed)) 102Version.TryParse(windowsSdkPackageVersion, out var windowsSdkPackageVersionParsed) && 120var highestMinimumVersion = knownFrameworkReferencesForSdkVersion.Max(t => t.minimumNetVersion);
GenerateBundle.cs (2)
103Version version = new(TargetFrameworkVersion); 111Version version)
GetAssemblyAttributes.cs (1)
27Version assemblyVersion = FileUtilities.TryGetAssemblyVersion(templatePath);
GetPackagesToPrune.cs (6)
146var targetFrameworkVersion = Version.Parse(key.TargetFrameworkVersion); 219var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion)); 243var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion)); 261var currentVersion = Version.Parse(targetFrameworkVersion);
ProcessFrameworkReferences.cs (9)
166private Version? _normalizedTargetFrameworkVersion; 624if (!Version.TryParse(TargetPlatformVersion, out var targetPlatformVersionParsed)) 799Version normalizedTargetFrameworkVersion, 1004var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); 1012var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); 1020var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); 1258internal static Version NormalizeVersion(Version version)
ResolveAppHosts.cs (1)
86var normalizedTargetFrameworkVersion = ProcessFrameworkReferences.NormalizeVersion(new Version(TargetFrameworkVersion));
ResolvePackageAssets.cs (11)
972private readonly Version _compilerVersion; 974private List<(string, LockFileLibrary, Version)> _potentialAnalyzers; 975private Version _maxApplicableVersion; 985if (ParseCompilerApiVersion(_cacheWriter._task.CompilerApiVersion, out ReadOnlyMemory<char> compilerName, out Version compilerVersion)) 1000if (IsFileCompilerVersionSpecific(file, out Version fileCompilerVersion)) 1008_potentialAnalyzers ??= new List<(string, LockFileLibrary, Version)>(); 1024private bool IsFileCompilerVersionSpecific(string file, out Version fileCompilerVersion) 1081private static bool ParseCompilerApiVersion(string compilerApiVersion, out ReadOnlyMemory<char> compilerName, out Version compilerVersion) 1114private static bool TryParseVersion(string value, int startIndex, out Version version) => 1117private static bool TryParseVersion(string value, int startIndex, int length, out Version version) 1120return Version.TryParse(value.AsSpan(startIndex, length), out version);
src\sdk\src\Common\EnvironmentVariableNames.cs (6)
61private static readonly Version s_version6_0 = new(6, 0); 66public static string? TryGetDotNetRootVariableName(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion) 69internal static string? TryGetDotNetRootVariableNameImpl(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion, Architecture currentArchitecture, bool is64bit, bool onlyUseArchSpecific = false) 108public static Version? TryParseTargetFrameworkVersion(string targetFrameworkVersion) 111return !string.IsNullOrEmpty(targetFrameworkVersion) && Version.TryParse(targetFrameworkVersion.Substring(1), out var version) ? version : null;
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
31if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Tasks\Common\ConflictResolution\ConflictItem.cs (10)
26Version? AssemblyVersion { get; } 30Version? FileVersion { get; } 57public ConflictItem(string fileName, string packageId, Version? assemblyVersion, Version? fileVersion) 69private Version? _assemblyVersion; 70public Version? AssemblyVersion 82Version.TryParse(assemblyVersionString, out _assemblyVersion); 133private Version? _fileVersion; 134public Version? FileVersion 146Version.TryParse(fileVersionString, out _fileVersion);
src\sdk\src\Tasks\Common\ConflictResolution\ConflictResolver.cs (8)
196var assemblyVersion1 = item1.AssemblyVersion; 197var assemblyVersion2 = item2.AssemblyVersion; 215Version? winningVersion; 216Version? losingVersion; 247var fileVersion1 = item1.FileVersion; 248var fileVersion2 = item2.FileVersion; 264Version? winningVersion; 265Version? losingVersion;
src\sdk\src\Tasks\Common\ConflictResolution\FrameworkListReader.cs (2)
89Version? assemblyVersion; 90if (string.IsNullOrEmpty(assemblyVersionString) || !Version.TryParse(assemblyVersionString, out assemblyVersion))
src\sdk\src\Tasks\Common\ConflictResolution\PlatformManifestReader.cs (3)
55Version? assemblyVersion = null, fileVersion = null; 57if (assemblyVersionString.Length != 0 && !Version.TryParse(assemblyVersionString, out assemblyVersion)) 67if (fileVersionString.Length != 0 && !Version.TryParse(fileVersionString, out fileVersion))
src\sdk\src\Tasks\Common\FileUtilities.cs (2)
10public static Version? GetFileVersion(string? sourcePath) 26public static Version? TryGetAssemblyVersion(string sourcePath)
src\sdk\src\Tasks\Common\FileUtilities.MetadataReader.cs (5)
23private static readonly ConcurrentDictionary<string, (DateTime LastKnownWriteTimeUtc, Version? Version)> s_versionCache = new(StringComparer.OrdinalIgnoreCase /* Not strictly correct on *nix. Fix? */); 25private static Version? GetAssemblyVersion(string sourcePath) 35Version? version = GetAssemblyVersionFromFile(sourcePath); 48static Version? GetAssemblyVersionFromFile(string sourcePath) 52Version? result = null;
WriteAppConfigWithSupportedRuntime.cs (2)
98&& Version.TryParse(targetFrameworkVersion.TrimStart('v', 'V'), out Version parsedVersion))
Microsoft.NET.HostModel (5)
Bundle\Bundler.cs (1)
48Version? targetFrameworkVersion = null,
Bundle\TargetInfo.cs (2)
27public readonly Version FrameworkVersion; 32public TargetInfo(OSPlatform os, Architecture arch, Version targetFrameworkVersion)
ComHost\RegFreeComManifest.cs (1)
86if (!reader.TryReadTypeLibGuidAndVersion(out Guid name, out Version version))
ComHost\TypeLibReader.cs (1)
52public bool TryReadTypeLibGuidAndVersion(out Guid typelibId, out Version version)
Microsoft.NET.Sdk.Publish.Tasks (18)
MsDeploy\CommonUtility.cs (6)
480Version currentMinVersion; 524Version minVersion = new(currentMinVersion.Major, currentMinVersion.Minor); 525Version? assemblyVersion = assemblyName.Version; // assembly version only accurate to the minor version 1812Version[] versionArray = versionsList.Values.Select(p => new Version(p)).ToArray(); 1817Version version = versionArray[i]; 1822Version webDelegationAssemblyVersion = version;
MsDeploy\DynamicAssembly.cs (2)
12public DynamicAssembly(string assemblyName, Version verToLoad, string publicKeyToken) 50public Version? Version { get; set; }
src\sdk\src\Common\EnvironmentVariableNames.cs (6)
61private static readonly Version s_version6_0 = new(6, 0); 66public static string? TryGetDotNetRootVariableName(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion) 69internal static string? TryGetDotNetRootVariableNameImpl(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion, Architecture currentArchitecture, bool is64bit, bool onlyUseArchSpecific = false) 108public static Version? TryParseTargetFrameworkVersion(string targetFrameworkVersion) 111return !string.IsNullOrEmpty(targetFrameworkVersion) && Version.TryParse(targetFrameworkVersion.Substring(1), out var version) ? version : null;
Tasks\MsDeploy\VsMsdeploy.cs (4)
18public MSWebDeploymentAssembly(Version verToLoad) : 25public static void SetVersion(Version version) 77public MSWebDelegationAssembly(Version verToLoad) : 85public static void SetVersion(Version version)
Microsoft.NET.Sdk.Razor.Tasks (2)
SdkRazorGenerate.cs (2)
103if (!System.Version.TryParse(Version, out var parsedVersion))
Microsoft.NET.Sdk.WorkloadManifestReader (10)
SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Common\EnvironmentVariableNames.cs (6)
61private static readonly Version s_version6_0 = new(6, 0); 66public static string? TryGetDotNetRootVariableName(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion) 69internal static string? TryGetDotNetRootVariableNameImpl(string runtimeIdentifier, string defaultAppHostRuntimeIdentifier, Version? targetFrameworkVersion, Architecture currentArchitecture, bool is64bit, bool onlyUseArchSpecific = false) 108public static Version? TryParseTargetFrameworkVersion(string targetFrameworkVersion) 111return !string.IsNullOrEmpty(targetFrameworkVersion) && Version.TryParse(targetFrameworkVersion.Substring(1), out var version) ? version : null;
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
31if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (2)
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
31if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))
Microsoft.Private.Windows.Core (1)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\OperatingSystemExtensions.cs (1)
25Version current = Environment.OSVersion.Version;
Microsoft.SourceLink.Bitbucket.Git (6)
GetSourceLinkUrl.cs (6)
25private static readonly Version s_versionWithNewUrlFormat = new Version(4, 7); 40var version = GetBitbucketEnterpriseVersion(hostItem); 54Version version) 89private Version GetBitbucketEnterpriseVersion(ITaskItem? hostItem) 94if (Version.TryParse(bitbucketEnterpriseVersionAsString, out var version))
Microsoft.SourceLink.GitLab (4)
GetSourceLinkUrl.cs (4)
24private static readonly Version s_versionWithNewUrlFormat = new Version(12, 0); 34private Version GetVersion(ITaskItem? hostItem) 39if (Version.TryParse(versionAsString, out var version))
Microsoft.TemplateEngine.Core (6)
Expressions\Shared\SharedEvaluatorDefinition.cs (6)
271Version? lv = left as Version; 275if (left is not string ls || !Version.TryParse(ls, out lv)) 281Version? rv = right as Version; 285if (right is not string rs || !Version.TryParse(rs, out rv))
Microsoft.TestPlatform.CoreUtilities (5)
Helpers\FileHelper.cs (4)
19private static readonly Version DefaultFileVersion = new(0, 0); 68public Version GetFileVersion(string path) 69=> Version.TryParse(FileVersionInfo.GetVersionInfo(path)?.FileVersion, out var currentVersion) ?
Helpers\Interfaces\IFileHelper.cs (1)
83Version GetFileVersion(string path);
Microsoft.TestPlatform.Extensions.BlameDataCollector (2)
CrashDumperFactory.cs (2)
27var isNet50OrNewer = tfm.FrameworkName == ".NETCoreApp" && Version.Parse(tfm.Version) >= Version.Parse("5.0.0.0");
Microsoft.TestPlatform.TestHostRuntimeProvider (8)
Hosting\DefaultTestHostManager.cs (6)
438Dictionary<string, Version?> highestFileVersions = new(); 439Dictionary<string, Version> conflictingExtensions = new(); 449var currentVersion = GetAndLogFileVersion(extensionFullPath); 451var oldVersionFound = highestFileVersions.TryGetValue(extensionAssemblyName, out var oldVersion); 495private Version GetAndLogFileVersion(string path) 497var fileVersion = _fileHelper.GetFileVersion(path);
Hosting\DotnetTestHostManager.cs (2)
520&& Version.TryParse(_targetFramework.Version, out var version)
Microsoft.VisualStudio.TestPlatform.ObjectModel (46)
Nuget.Frameworks\CompatibilityProvider.cs (2)
216private static bool IsVersionCompatible(Version target, Version candidate)
Nuget.Frameworks\FrameworkConstants.cs (6)
11public static readonly Version EmptyVersion = new(0, 0, 0, 0); 12public static readonly Version MaxVersion = new(int.MaxValue, 0, 0, 0); 13public static readonly Version Version5 = new(5, 0, 0, 0); 14public static readonly Version Version6 = new(6, 0, 0, 0); 15public static readonly Version Version7 = new(7, 0, 0, 0); 16public static readonly Version Version10 = new(10, 0, 0, 0);
Nuget.Frameworks\FrameworkNameHelpers.cs (4)
22public static string GetVersionString(Version version) 44public static Version GetVersion(string? versionString) 55return Version.Parse(versionString); 68return Version.Parse(string.Join(".", versionString.ToCharArray().Take(4)));
Nuget.Frameworks\FrameworkNameProvider.cs (7)
154public bool TryGetVersion(string versionString, [NotNullWhen(true)] out Version? version) 166return Version.TryParse(versionString, out version); 179return Version.TryParse(string.Join(".", versionString.ToCharArray().Take(4)), out version); 184public bool TryGetPlatformVersion(string versionString, [NotNullWhen(true)] out Version? version) 197return Version.TryParse(versionString, out version); 201public string GetVersionString(string framework, Version version) 264static bool IsZero(Version version)
Nuget.Frameworks\IFrameworkNameProvider.cs (3)
35bool TryGetVersion(string versionString, [NotNullWhen(true)] out Version? version); 41bool TryGetPlatformVersion(string versionString, [NotNullWhen(true)] out Version? version); 46string GetVersionString(string framework, Version version);
Nuget.Frameworks\NuGetFramework.cs (13)
18private readonly Version _frameworkVersion; 34public NuGetFramework(string framework, Version version) 44public NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string? frameworkProfile) 52public NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string platform, Version platformVersion) 57internal NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string profile, string platform, Version platformVersion) 81public Version Version => _frameworkVersion; 91public Version PlatformVersion { get; } 298private static string GetDisplayVersion(Version version) 467private static Version NormalizeVersion(Version version) 469var normalized = version;
Nuget.Frameworks\NuGetFrameworkFactory.cs (11)
80Version targetFrameworkVersion; 127Version platformVersion; 159ParseFrameworkNameParts(mappings, parts, out string? framework, out Version version, out string? profile); 175private static void ParseFrameworkNameParts(IFrameworkNameProvider mappings, string[] parts, out string framework, out Version version, out string? profile) 194version = Version.TryParse(versionString, out Version? parsedVersion) 220private static void ParsePlatformParts(string[] parts, out string targetPlatformIdentifier, out Version platformVersion) 234platformVersion = Version.TryParse(versionString, out Version? parsedVersion) 285var version = FrameworkConstants.EmptyVersion; 314Version? platformVersion = FrameworkConstants.EmptyVersion;
Mono.Cecil (12)
Mono.Cecil\AssemblyNameDefinition.cs (1)
26 public AssemblyNameDefinition (string name, Version version)
Mono.Cecil\AssemblyNameReference.cs (6)
23 Version version; 50 public Version Version { 235 public AssemblyNameReference (string name, Version version) 253 public static Version ZeroVersion = new Version (0, 0, 0 ,0); 255 public static Version CheckVersion (Version version)
Mono.Cecil\AssemblyWriter.cs (1)
1159 var version = reference.Version;
Mono.Cecil\BaseAssemblyResolver.cs (1)
229 static bool IsZero (Version version)
Mono.Cecil\TypeSystem.cs (1)
112 Version GetCorlibVersion ()
Mono.Cecil\WindowsRuntimeProjections.cs (2)
112 static readonly Version version = new Version (4, 0, 0, 0); 199 Version corlib_version = new Version (255, 255, 255, 255);
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1232[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Version))]
netstandard (1)
netstandard.cs (1)
2243[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Version))]
NuGet.Build.Tasks.Pack (10)
PackTaskLogic.cs (10)
55Version version; 56if (!Version.TryParse(request.MinClientVersion, out version)) 197Version version; 198if (!Version.TryParse(request.MinClientVersion, out version)) 273var version = GetLicenseExpressionVersion(request); 320private static Version GetLicenseExpressionVersion(IPackTaskRequest<IMSBuildItem> request) 322Version version; 329if (!Version.TryParse(request.PackageLicenseExpressionVersion, out version)) 606var version = PackageType.EmptyVersion; 610_ = Version.TryParse(versionString, out version);
NuGet.CommandLine.XPlat (24)
_generated\16\PackageSearchJsonContext.NuGetVersion.g.cs (3)
53var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Version> 68AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.NuGetVersion).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 71properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Version>(options, info0);
_generated\30\PackageSearchJsonContext.Version.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version>? _Version; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> Version 22get => _Version ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version>)Options.GetTypeInfo(typeof(global::System.Version)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> Create_Version(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Version>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.Version>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.VersionConverter);
_generated\36\PackageSearchJsonContext.GetJsonTypeInfo.g.cs (1)
142if (type == typeof(global::System.Version))
_generated\5\PackageSearchJsonContext.NuGetFramework.g.cs (6)
74var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Version> 89AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 92properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Version>(options, info1); 116var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Version> 131AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("PlatformVersion", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 134properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Version>(options, info3);
_generated\8\PackageSearchJsonContext.LicenseMetadata.g.cs (6)
32ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.Packaging.LicenseMetadata((global::NuGet.Packaging.LicenseType)args[0], (string)args[1], (global::NuGet.Packaging.Licenses.NuGetLicenseExpression)args[2], (global::System.Collections.Generic.IReadOnlyList<string>)args[3], (global::System.Version)args[4]), 35ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.Packaging.LicenseMetadata).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::NuGet.Packaging.LicenseType), typeof(string), typeof(global::NuGet.Packaging.Licenses.NuGetLicenseExpression), typeof(global::System.Collections.Generic.IReadOnlyList<string>), typeof(global::System.Version)}, modifiers: null), 134var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Version> 149AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.LicenseMetadata).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 152properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Version>(options, info4); 251ParameterType = typeof(global::System.Version),
NuGet.Commands (5)
CommandArgs\PackArgs.cs (1)
32public Version MinClientVersion { get; set; }
Utility\MSBuildProjectFrameworkUtility.cs (4)
275if (!Version.TryParse(windowsTargetPlatformMinVersion, out Version cppCliVersion)) 356&& framework.Version.Equals(Version.Parse("4.5.1.0"))) 363&& framework.Version.Equals(Version.Parse("4.5.0.0")))
NuGet.Frameworks (49)
CompatibilityProvider.cs (2)
235private static bool IsVersionCompatible(Version target, Version candidate)
def\IFrameworkNameProvider.cs (3)
35bool TryGetVersion(string versionString, [NotNullWhen(true)] out Version? version); 41bool TryGetPlatformVersion(string versionString, [NotNullWhen(true)] out Version? version); 46string GetVersionString(string framework, Version version);
FrameworkConstants.cs (9)
10public static readonly Version EmptyVersion = new Version(0, 0, 0, 0); 11public static readonly Version MaxVersion = new Version(int.MaxValue, 0, 0, 0); 12public static readonly Version Version5 = new Version(5, 0, 0, 0); 13public static readonly Version Version6 = new Version(6, 0, 0, 0); 14public static readonly Version Version7 = new Version(7, 0, 0, 0); 15public static readonly Version Version8 = new Version(8, 0, 0, 0); 16public static readonly Version Version9 = new Version(9, 0, 0, 0); 17public static readonly Version Version10 = new Version(10, 0, 0, 0); 18public static readonly Version Version11 = new Version(11, 0, 0, 0);
FrameworkNameHelpers.cs (4)
22public static string GetVersionString(Version version) 44public static Version GetVersion(string? versionString) 55return Version.Parse(versionString); 68return Version.Parse(string.Join(".", versionString.ToCharArray().Take(4)));
FrameworkNameProvider.cs (7)
161public bool TryGetVersion(string versionString, [NotNullWhen(true)] out Version? version) 173return Version.TryParse(versionString, out version); 186return Version.TryParse(string.Join(".", versionString.ToCharArray().Take(4)), out version); 191public bool TryGetPlatformVersion(string versionString, [NotNullWhen(true)] out Version? version) 204return Version.TryParse(versionString, out version); 208public string GetVersionString(string framework, Version version) 271static bool IsZero(Version version)
NuGetFramework.cs (13)
18private readonly Version _frameworkVersion; 34public NuGetFramework(string framework, Version version) 44public NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string? frameworkProfile) 52public NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string platform, Version platformVersion) 57internal NuGetFramework(string frameworkIdentifier, Version frameworkVersion, string profile, string platform, Version platformVersion) 81public Version Version => _frameworkVersion; 91public Version PlatformVersion { get; } 298private static string GetDisplayVersion(Version version) 468private static Version NormalizeVersion(Version version) 470var normalized = version;
NuGetFrameworkFactory.cs (11)
77Version targetFrameworkVersion; 124Version platformVersion; 156ParseFrameworkNameParts(mappings, parts, out string? framework, out Version version, out string? profile); 172private static void ParseFrameworkNameParts(IFrameworkNameProvider mappings, string[] parts, out string framework, out Version version, out string? profile) 191version = Version.TryParse(versionString, out Version? parsedVersion) 217private static void ParsePlatformParts(string[] parts, out string targetPlatformIdentifier, out Version platformVersion) 231platformVersion = Version.TryParse(versionString, out Version? parsedVersion) 282var version = FrameworkConstants.EmptyVersion; 311Version? platformVersion = FrameworkConstants.EmptyVersion;
NuGet.PackageManagement (4)
IDE\IProductUpdateService.cs (4)
20public ProductUpdateAvailableEventArgs(Version currentVersion, Version newVersion) 26public Version CurrentVersion { get; private set; } 27public Version NewVersion { get; private set; }
NuGet.Packaging (18)
Core\NuspecUtility.cs (2)
84Version? version; 88if (!System.Version.TryParse(versionAttribute.Value, out version))
Core\PackageType.cs (3)
14public static readonly Version EmptyVersion = new Version(0, 0); 24public PackageType(string name, Version version) 38public Version Version { get; }
NuspecReader.cs (2)
450Version? version = null; 453if (!System.Version.TryParse(versionValue, out version))
PackageCreation\Authoring\IPackageMetadata.cs (1)
49Version? MinClientVersion { get; }
PackageCreation\Authoring\LicenseMetadata.cs (4)
18public static readonly Version EmptyVersion = new Version(1, 0, 0); 19public static readonly Version CurrentVersion = new Version(1, 0, 0); 46public Version Version { get; } 48public LicenseMetadata(LicenseType type, string license, NuGetLicenseExpression? expression, IReadOnlyList<string>? warningsAndErrors, Version version)
PackageCreation\Authoring\ManifestMetadata.cs (3)
74Version? version = null; 75if (!String.IsNullOrEmpty(value) && !System.Version.TryParse(value, out version)) 85public Version? MinClientVersion { get; private set; }
PackageCreation\Authoring\ManifestReader.cs (2)
197Version? version = null; 204if (!Version.TryParse(versionValue, out version!))
PackageCreation\Authoring\PackageBuilder.cs (1)
322public Version? MinClientVersion { get; set; }
NuGet.Protocol (14)
_generated\10\JsonContext.NuGetVersion.g.cs (3)
53var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Version> 68AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.NuGetVersion).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 71properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Version>(options, info0);
_generated\19\JsonContext.Version.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version>? _Version; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> Version 22get => _Version ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version>)Options.GetTypeInfo(typeof(global::System.Version)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> Create_Version(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Version>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Version> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.Version>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.VersionConverter);
_generated\24\JsonContext.GetJsonTypeInfo.g.cs (1)
98if (type == typeof(global::System.Version))
Model\PackageSearchMetadata.cs (2)
174_ = System.Version.TryParse(LicenseExpressionVersion, out var effectiveVersion);
NuGet.Versioning (15)
NuGetVersion.cs (3)
41public NuGetVersion(Version version, string? releaseLabel = null, string? metadata = null) 146public NuGetVersion(Version version, IEnumerable<string>? releaseLabels, string? metadata, string? originalVersion) 176public Version Version { get; }
NuGetVersionFactory.cs (3)
56Version? systemVersion; 131private static bool TryGetNormalizedVersion(string str, [NotNullWhen(true)] out Version? version) 312private static string GetLegacyString(Version version, IEnumerable<string>? releaseLabels, string? metadata)
SemanticVersion.cs (3)
90protected SemanticVersion(Version version, string? releaseLabel = null, string? metadata = null) 129protected SemanticVersion(Version version, IEnumerable<string>? releaseLabels, string? metadata) 136var normalizedVersion = NormalizeVersionValue(version);
SemanticVersionFactory.cs (6)
41if (Version.TryParse(versionString, out Version? systemVersion)) 80var ver = NormalizeVersionValue(systemVersion); 230internal static Version NormalizeVersionValue(Version version) 232var normalized = version;
PresentationBuildTasks (6)
MS\Internal\MarkupCompiler\VersionHelper.cs (6)
16private static readonly Version NullVersion = new Version(0, 0, 0, 0); 24internal static bool TryParse(string s, out Version version) 41internal static bool TryParseAssemblyVersion(string s, bool allowWildcard, out Version version, out bool hasWildcard) 59private static bool TryParse(string s, bool allowWildcard, ushort maxValue, bool allowPartialParse, out Version version, out bool hasWildcard) 181public static Version? GenerateVersionFromPatternAndCurrentTime(DateTime time, Version pattern)
PresentationCore (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (2)
104Version reqVersion = assemblyName.Version; 111Version curVersion = curAsmName.Version;
System\Windows\Media\Imaging\BitmapCodecInfo.cs (2)
110public virtual System.Version Version 153public virtual Version SpecificationVersion
PresentationFramework (6)
System\Windows\Controls\WebBrowser.cs (1)
751Version osver = Environment.OSVersion.Version;
System\Windows\Documents\Serialization\SerializerDescriptor.cs (4)
298public Version AssemblyVersion 309public Version WinFXVersion 368private Version _assemblyVersion; 369private Version _winFXVersion;
System\Windows\Standard\Utilities.cs (1)
22private static readonly Version _osVersion = Environment.OSVersion.Version;
RepoTasks (1)
FileUtilities.cs (1)
18public static Version GetFileVersion(string sourcePath)
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentityUtils.cs (1)
28Version version = assemblyDefinition.Version;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
36var assemblyVersion = thisAssemblyName.Version;
rzc (1)
MetadataReaderExtensions.cs (1)
53Version version,
sdk-tasks (1)
CalculateTemplateVersions.cs (1)
77var brandName = System.Version.Parse(g.Key).Major >= 5 ?
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
100yield return new TestData<Version>(new(1, 2, 3, 4), """{"$comment":"Represents a version string.", "type":["string","null"],"pattern":"^\\d+(\\.\\d+){1,3}$"}"""); 1244[JsonSerializable(typeof(Version))]
System.ComponentModel.TypeConverter (11)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
179[typeof(Version)] = new IntrinsicTypeConverterData((type) => new VersionConverter()),
System\ComponentModel\VersionConverter.cs (10)
24return sourceType == typeof(string) || sourceType == typeof(Version) || base.CanConvertFrom(context, sourceType); 33return destinationType == typeof(Version) || destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); 46return Version.Parse(versionString); 50throw new FormatException(SR.Format(SR.ConvertInvalidPrimitive, versionString, nameof(Version)), e); 54if (value is Version version) 70if (value is Version version) 74ConstructorInfo? ctor = typeof(Version).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(int), typeof(int), typeof(int) }, null); 84if (destinationType == typeof(Version)) 97return Version.TryParse(version, out _); 99return value is Version;
System.Configuration.ConfigurationManager (5)
System\Configuration\LocalFileSettingsProvider.cs (5)
292Version currentVersion; 293if (!Version.TryParse(ConfigurationManagerInternalFactory.Instance.ExeProductVersion, out currentVersion)) 298Version previousVersion = null; 308Version tempVersion; 310if (Version.TryParse(directory.Name, out tempVersion) && tempVersion < currentVersion)
System.Diagnostics.DiagnosticSource (1)
src\runtime\artifacts\obj\System.Diagnostics.DiagnosticSource\Release\net11.0\ThisAssembly.cs (1)
10public static Version AssemblyFileVersion { get; } = new(BuildAssemblyFileVersion);
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
93Version productVersion = assemblyDefinition.Version;
System.Net.Http (15)
System\Net\Http\DiagnosticsHelper.cs (1)
29internal static string GetProtocolVersionString(Version httpVersion) => (httpVersion.Major, httpVersion.Minor) switch
System\Net\Http\HttpClient.cs (2)
29private Version _defaultRequestVersion = HttpRequestMessage.DefaultRequestVersion; 52public Version DefaultRequestVersion
System\Net\Http\HttpRequestMessage.cs (3)
15internal static Version DefaultRequestVersion => HttpVersion.Version11; 31private Version _version; 36public Version Version
System\Net\Http\HttpResponseMessage.cs (4)
14private static Version DefaultResponseVersion => HttpVersion.Version11; 21private Version _version; 25public Version Version 39internal void SetVersionWithoutValidation(Version value) => _version = value;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
732private async ValueTask<Stream> ApplyPlaintextFilterAsync(bool async, Stream stream, Version httpVersion, HttpRequestMessage request, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnectionSettings.cs (1)
58internal Version _maxHttpVersion;
System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs (3)
14private readonly Version _negotiatedHttpVersion; 17internal SocketsHttpPlaintextStreamFilterContext(Stream plaintextStream, Version negotiatedHttpVersion, HttpRequestMessage initialRequestMessage) 32public Version NegotiatedHttpVersion => _negotiatedHttpVersion;
System.Net.Http.WinHttpHandler (5)
System\Net\Http\WinHttpHandler.cs (5)
43internal static readonly Version HttpVersion20 = new Version(2, 0); 44internal static readonly Version HttpVersion30 = new Version(3, 0); 45internal static readonly Version HttpVersionUnknown = new Version(0, 0); 1437private void SetEnableHttp2PlusClientCertificate(Uri requestUri, Version requestVersion) 1512private void SetRequestHandleHttp2Options(SafeWinHttpHandle requestHandle, Version requestVersion)
System.Net.HttpListener (5)
System\Net\HttpListenerRequest.cs (2)
22private Version _version; 228public Version ProtocolVersion => _version;
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
104_version = Version.Parse(version.Slice("HTTP/".Length));
System\Net\Managed\HttpListenerResponse.Managed.cs (2)
41private Version _version = HttpVersion.Version11; 58public Version ProtocolVersion
System.Net.Primitives (10)
System\Net\HttpVersion.cs (10)
8/// <summary>Defines a <see cref="Version"/> instance that indicates an unknown version of HTTP.</summary> 9public static readonly Version Unknown = new Version(0, 0); 10/// <summary>Defines a <see cref="Version"/> instance for HTTP 1.0.</summary> 11public static readonly Version Version10 = new Version(1, 0); 12/// <summary>Defines a <see cref="Version"/> instance for HTTP 1.1.</summary> 13public static readonly Version Version11 = new Version(1, 1); 14/// <summary>Defines a <see cref="Version"/> instance for HTTP 2.0.</summary> 15public static readonly Version Version20 = new Version(2, 0); 16/// <summary>Defines a <see cref="Version"/> instance for HTTP 3.0.</summary> 17public static readonly Version Version30 = new Version(3, 0);
System.Net.Quic (3)
System\Net\Quic\Internal\MsQuicApi.cs (3)
21private static readonly Version s_minWindowsVersion = new Version(10, 0, 20145, 1000); 23private static readonly Version s_minMsQuicVersion = new Version(2, 2, 2); 59internal static Version? Version { get; }
System.Net.Requests (3)
System\Net\HttpWebRequest.cs (1)
816public Version ProtocolVersion
System\Net\HttpWebResponse.cs (1)
185public Version ProtocolVersion
System\Net\ServicePoint\ServicePoint.cs (1)
69public virtual Version ProtocolVersion { get; internal set; } = new Version(1, 1);
System.Net.WebSockets.Client (1)
System\Net\WebSockets\BrowserWebSockets\ClientWebSocketOptions.cs (1)
35public Version HttpVersion
System.Private.CoreLib (67)
_generated\1\ProductVersionInfo.g.cs (1)
10public static Version Version => new Version(11, 0, 0);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (2)
13public static unsafe string ComputeDisplayName(string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null) 20public static void AppendDisplayName(ref ValueStringBuilder vsb, string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (4)
20public AssemblyNameParts(string name, Version? version, string? cultureName, AssemblyNameFlags flags, byte[]? publicKeyOrToken) 30public readonly Version? _version; 110Version? version = null; 247private static unsafe bool TryParseVersion(string attributeValue, ref Version? version)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (2)
13public ApplicationId(byte[] publicKeyToken, string name, Version version, string? processorArchitecture, string? culture) 32public Version Version { get; }
src\runtime\src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (5)
50private readonly Version _version; 55public OperatingSystem(PlatformID platform, Version version) : this(platform, version, null) 59internal OperatingSystem(PlatformID platform, Version version, string? servicePack) 84public Version Version => _version; 354Version current = Environment.OSVersion.Version;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
155public virtual Assembly GetSatelliteAssembly(CultureInfo culture, Version? version) { throw NotImplemented.ByDesign; }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (2)
25private Version? _version; 70public Version? Version
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
270private static Assembly? InternalGetSatelliteAssembly(Assembly mainAssembly, CultureInfo culture, Version? version)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (6)
122private Version? _satelliteContractVersion; 526protected static Version? GetSatelliteContractVersion(Assembly a) 538if (!Version.TryParse(v, out Version? version)) 772internal Version? SatelliteContractVersion 778internal static Version? ObtainSatelliteContractVersion(Assembly a) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (5)
12private readonly Version _version = null!; 31public Version Version 89public FrameworkName(string identifier, Version version) 94public FrameworkName(string identifier, Version version, string? profile) 169_version = Version.Parse(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (33)
23public sealed class Version : ICloneable, IComparable, IComparable<Version?>, IEquatable<Version?>, ISpanFormattable, IUtf8SpanFormattable, IUtf8SpanParsable<Version> 69Version v = Parse(version); 84private Version(Version version) 119if (version is Version v) 127public int CompareTo(Version? value) 141return Equals(obj as Version); 144public bool Equals([NotNullWhen(true)] Version? obj) 284public static Version Parse(string input) 291public static Version Parse(ReadOnlySpan<char> input) => 295static Version IUtf8SpanParsable<Version>.Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) 297Version? result = ParseVersion(utf8Text, throwOnFailure: false); 315public static Version Parse(ReadOnlySpan<byte> utf8Text) => 318public static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out Version? result) 330public static bool TryParse(ReadOnlySpan<char> input, [NotNullWhen(true)] out Version? result) 345public static bool TryParse(ReadOnlySpan<byte> utf8Text, [NotNullWhen(true)] out Version? result) 352static bool IUtf8SpanParsable<Version>.TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, [NotNullWhen(true)] out Version? result) 358private static Version? ParseVersion<TChar>(ReadOnlySpan<TChar> input, bool throwOnFailure) 466public static bool operator ==(Version? v1, Version? v2) 479public static bool operator !=(Version? v1, Version? v2) => !(v1 == v2); 481public static bool operator <(Version? v1, Version? v2) 491public static bool operator <=(Version? v1, Version? v2) 501public static bool operator >(Version? v1, Version? v2) => v2 < v1; 503public static bool operator >=(Version? v1, Version? v2) => v2 <= v1;
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\AssemblyNameInfo.cs (1)
79public Version? Version { get; }
System\Reflection\Runtime\General\ThunkedApis.cs (1)
81public sealed override Assembly GetSatelliteAssembly(CultureInfo culture, Version version) { throw new PlatformNotSupportedException(); }
System\Reflection\RuntimeAssembly.cs (1)
13internal static Assembly? InternalGetSatelliteAssembly(Assembly mainAssembly, CultureInfo culture, Version? version, bool throwOnFileNotFound)
System\Reflection\RuntimeAssemblyName.cs (2)
20public RuntimeAssemblyName(string name, Version? version, string? cultureName, AssemblyNameFlags flags, byte[]? publicKeyOrToken) 48public Version? Version { get; }
System.Private.CoreLib.Generators (1)
ProductVersionInfoGenerator.cs (1)
27string environmentVersion = Version.Parse(productVersion.Split('-')[0]).ToString();
System.Private.TypeLoader (2)
Internal\Reflection\Execution\AssemblyBinderImplementation.cs (2)
136private static bool AssemblyVersionMatches(Version refVersion, Version defVersion)
System.Private.Xml (2)
System\Xml\Xslt\XslCompiledTransform.cs (2)
42private static readonly Version? s_version = typeof(XslCompiledTransform).Assembly.GetName().Version; 190if (s_version < Version.Parse(generatedCodeAttr.Version!))
System.Reflection.Context (2)
System\Reflection\Context\Delegation\DelegatingAssembly.cs (1)
188public override Assembly GetSatelliteAssembly(CultureInfo culture, Version? version)
System\Reflection\Context\Projection\ProjectingAssembly.cs (1)
84public override Assembly GetSatelliteAssembly(CultureInfo culture, Version? version)
System.Reflection.Emit (1)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
977private AssemblyReferenceHandle AddAssemblyReference(string? name, Version? version, string? culture,
System.Reflection.Metadata (21)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (2)
13public static unsafe string ComputeDisplayName(string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null) 20public static void AppendDisplayName(ref ValueStringBuilder vsb, string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (4)
20public AssemblyNameParts(string name, Version? version, string? cultureName, AssemblyNameFlags flags, byte[]? publicKeyOrToken) 30public readonly Version? _version; 110Version? version = null; 247private static unsafe bool TryParseVersion(string attributeValue, ref Version? version)
System\Reflection\Metadata\AssemblyNameInfo.cs (2)
42public AssemblyNameInfo(string name, Version? version = null, string? cultureName = null, AssemblyNameFlags flags = AssemblyNameFlags.None, ImmutableArray<byte> publicKeyOrToken = default) 79public Version? Version { get; }
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (5)
17private struct AssemblyRefTableRow { public Version Version; public BlobHandle PublicKeyToken; public StringHandle Name; public StringHandle Culture; public uint Flags; public BlobHandle HashValue; } 19private struct AssemblyRow { public uint HashAlgorithm; public Version Version; public ushort Flags; public BlobHandle AssemblyKey; public StringHandle AssemblyName; public StringHandle AssemblyCulture; } 389Version version, 420Version version, 2222var version = _assemblyRow.Value.Version;
System\Reflection\Metadata\Internal\Tables.cs (2)
1959internal Version GetVersion() 2087internal Version GetVersion(int rowId)
System\Reflection\Metadata\MetadataReader.netstandard.cs (2)
15internal AssemblyName GetAssemblyName(StringHandle nameHandle, Version version, StringHandle cultureHandle, BlobHandle publicKeyOrTokenHandle, AssemblyHashAlgorithm assemblyHashAlgorithm, AssemblyFlags flags) 49internal AssemblyNameInfo GetAssemblyNameInfo(StringHandle nameHandle, Version version, StringHandle cultureHandle, BlobHandle publicKeyOrTokenHandle, AssemblyFlags flags)
System\Reflection\Metadata\TypeSystem\AssemblyDefinition.cs (1)
26public Version Version
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (3)
16private static readonly Version s_version_4_0_0_0 = new Version(4, 0, 0, 0); 34public Version Version 129private static Version GetVirtualVersion()
System.Reflection.MetadataLoadContext (8)
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (1)
205public sealed override Assembly GetSatelliteAssembly(CultureInfo culture, Version? version) => throw new NotSupportedException(SR.NotSupported_SatelliteAssembly);
System\Reflection\TypeLoading\General\AssemblyNameData.cs (1)
20public Version? Version;
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (1)
18Version? version = a.Version.AdjustForUnspecifiedVersionComponents();
System\Reflection\TypeLoading\General\Helpers.cs (2)
150public static Version? AdjustForUnspecifiedVersionComponents(this Version v)
System\Reflection\TypeLoading\General\RoAssemblyName.cs (3)
24public Version Version { get; } 33private static readonly Version s_Version0000 = new Version(0, 0, 0, 0); 35public RoAssemblyName(string? name, Version? version, string? cultureName, byte[]? publicKeyToken, AssemblyNameFlags flags)
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
909[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Version))]
System.Security.Cryptography (1)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.cs (1)
66Version version = Environment.OSVersion.Version;
System.Security.Permissions (7)
System\Security\Permissions\StrongNameIdentityPermission.cs (2)
12public StrongNameIdentityPermission(StrongNamePublicKeyBlob blob, string name, Version version) { } 15public Version Version { get; set; }
System\Security\Policy\StrongName.cs (3)
13public StrongName(StrongNamePublicKeyBlob blob, string name, Version version) { } 16public Version Version { get { return default(Version); } }
System\Security\Policy\StrongNameMembershipCondition.cs (2)
13public StrongNameMembershipCondition(StrongNamePublicKeyBlob blob, string name, Version version) { } 16public Version Version { get; set; }
System.Text.Json (12)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
96type == typeof(Guid) || type == typeof(Uri) || type == typeof(Version))
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (8)
11internal sealed class VersionConverter : JsonPrimitiveConverter<Version?> 17public override Version? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 32private static unsafe Version ReadCore(ref Utf8JsonReader reader) 57if (Version.TryParse(utf8Source, out Version? result)) 99public override unsafe void Write(Utf8JsonWriter writer, Version? value, JsonSerializerOptions options) 117internal override Version ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 122internal override unsafe void WriteAsPropertyNameCore(Utf8JsonWriter writer, Version value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
265/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="Version"/> values. 268public static JsonConverter<Version?> VersionConverter => s_versionConverter ??= new VersionConverter(); 269private static JsonConverter<Version?>? s_versionConverter;
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
178public INamedTypeSymbol? VersionType => GetOrResolveType(typeof(Version), ref _VersionType);
System.Windows.Forms (9)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
608public Version Version
System\Windows\Forms\FeatureSupport.cs (5)
25public static bool IsPresent(string featureClassName, string featureConstName, Version minimumVersion) 49public static Version? GetVersionPresent(string featureClassName, string featureConstName) 79public virtual bool IsPresent(object feature, Version minimumVersion) 81Version? ver = GetVersionPresent(feature); 94public abstract Version? GetVersionPresent(object feature);
System\Windows\Forms\IFeatureSupport.cs (2)
21bool IsPresent(object feature, Version minimumVersion); 26Version? GetVersionPresent(object feature);
System\Windows\Forms\OSFeature.cs (1)
40public override Version? GetVersionPresent(object feature)
System.Xaml (2)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (2)
104Version reqVersion = assemblyName.Version; 111Version curVersion = curAsmName.Version;