From ab1f8ef0f1ffcb7952a411719669c4a565775b43 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 27 Feb 2023 16:26:40 -0500 Subject: [PATCH 01/11] Fixed memory corruption in VisualStudioFinder VisualStudioFinder.GetLatestPath() uses COM to iterate over the install locations for Visual Studio but somehow, once the method returns to the caller (GetLatestVisualStudioPath), none of the methods can be relied on to return sane values. Therefore, the easiest solution is to track the values we care about and just return them to our caller who can then avoid needing to re-make the same COM invocations a second time. --- .../VisualStudioFinder.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index 6e2e39563..6c01a7b2d 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -35,35 +35,34 @@ public void Configure(WorkspaceOptions options) private (string? Path, int? Version) GetLatestVisualStudioPath(string? suppliedPath) { - var latest = GetLatestPath(suppliedPath); + var latest = GetLatestVisualStudio(suppliedPath); - if (latest is null) + if (latest.InstallPath is null) { _logger.LogWarning("Did not find a Visual Studio instance"); return default; } - var version = Version.Parse(latest.GetInstallationVersion()); - var installation = latest.GetInstallationPath(); + _logger.LogError("InstallationPath:{InstallPath}  Version:{Version}", latest.InstallPath, latest.Version); - if (Directory.Exists(installation)) + if (Directory.Exists(latest.InstallPath)) { - _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", version, installation); + _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", latest.Version, latest.InstallPath); - return (installation, version?.Major); + return (latest.InstallPath, latest.Version.Major); } else { - _logger.LogWarning("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", version, installation); + _logger.LogWarning("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", latest.Version, latest.InstallPath); return default; } } - private ISetupInstance2? GetLatestPath(string? suppliedPath) + private (string? InstallPath, Version Version) GetLatestVisualStudio(string? suppliedPath) { - var result = default(ISetupInstance2); var resultVersion = new Version(0, 0); + string? resultPath = null; try { @@ -107,17 +106,19 @@ public void Configure(WorkspaceOptions options) if (instanceHasMSBuild && instance is not null) { - if (suppliedPath is not null && string.Equals(suppliedPath, instance.GetInstallationPath(), StringComparison.OrdinalIgnoreCase)) + var installPath = instance.GetInstallationPath(); + + if (suppliedPath is not null && string.Equals(suppliedPath, installPath, StringComparison.OrdinalIgnoreCase)) { _logger.LogTrace("Identified supplied path for Visual Studio v{Version} [{Path}]", version, instance.GetInstallationPath()); - return instance; + return (installPath, version); } else if (version > resultVersion) { _logger.LogTrace("Found Visual Studio v{Version} [{Path}]", version, instance.GetInstallationPath()); - result = instance; + resultPath = installPath; resultVersion = version; } } @@ -133,7 +134,7 @@ public void Configure(WorkspaceOptions options) // This is OK, VS "15" or greater likely not installed. } - return result; + return (resultPath, resultVersion); } private static ISetupConfiguration GetQuery() From 91dd355a1917026e483f32355dfdb5ac1130abb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 27 Feb 2023 18:05:04 -0500 Subject: [PATCH 02/11] Removed LogError call used for debugging --- .../VisualStudioFinder.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index 6c01a7b2d..702b56fcf 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -43,8 +43,6 @@ public void Configure(WorkspaceOptions options) return default; } - _logger.LogError("InstallationPath:{InstallPath}  Version:{Version}", latest.InstallPath, latest.Version); - if (Directory.Exists(latest.InstallPath)) { _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", latest.Version, latest.InstallPath); From 52963552e9396453b2c6368dee0cf140eece748b Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Wed, 1 Mar 2023 11:25:18 -0800 Subject: [PATCH 03/11] Improve support for migrations --- .../MSBuild.Abstractions/MSBuildHelpers.cs | 3 ++- .../MSBuild.Abstractions/ProjectExtensions.cs | 11 +++++++---- .../MSBuild.Conversion.Facts/MSBuildFacts.cs | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/extensions/try-convert/MSBuild.Abstractions/MSBuildHelpers.cs b/src/extensions/try-convert/MSBuild.Abstractions/MSBuildHelpers.cs index 80cd80674..6ef938dae 100644 --- a/src/extensions/try-convert/MSBuild.Abstractions/MSBuildHelpers.cs +++ b/src/extensions/try-convert/MSBuild.Abstractions/MSBuildHelpers.cs @@ -344,7 +344,8 @@ public static ProjectItemElement GetPackagesConfigItem(ProjectItemGroupElement p /// Finds the property group with the TFM specified, which is normally the top-level property group. /// public static ProjectPropertyGroupElement GetOrCreateTopLevelPropertyGroupWithTFM(IProjectRootElement rootElement) => - rootElement.PropertyGroups.Single(pg => pg.Properties.Any(p => p.ElementName.Equals(MSBuildFacts.TargetFrameworkNodeName, StringComparison.OrdinalIgnoreCase))) + rootElement.PropertyGroups.Single(pg => pg.Properties.Any(p => p.ElementName.Equals(MSBuildFacts.TargetFrameworkNodeName, StringComparison.OrdinalIgnoreCase) + || p.ElementName.Equals(MSBuildFacts.TargetFrameworksNodeName, StringComparison.OrdinalIgnoreCase))) ?? rootElement.AddPropertyGroup(); /// diff --git a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs index acb5668be..8bf6a91c1 100644 --- a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs +++ b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs @@ -50,8 +50,8 @@ public static string GetTargetFramework(this IProject project) ".NETCore" => "net", // UWP ".NETCoreApp" => "netcoreapp", ".NETPortable" => "netstandard", - "MonoAndroid" => "net", - "Xamarin.iOS" => "net", + "MonoAndroid" => "net6.0-android", + "Xamarin.iOS" => "net6.0-ios", _ => throw new InvalidOperationException($"Unknown {MSBuildFacts.LegacyTargetFrameworkPropertyNodeName}: {tfi}"), }; @@ -68,8 +68,11 @@ public static string GetTargetFramework(this IProject project) } } } - - if (tfi.Equals(MSBuildFacts.NETPortableTFValuePrefix, StringComparison.OrdinalIgnoreCase)) + else if (tfi == "MonoAndroid" || tfi == "Xamarin.iOS") + { + return tf; + } + else if (tfi.Equals(MSBuildFacts.NETPortableTFValuePrefix, StringComparison.OrdinalIgnoreCase)) { var profile = project.GetPropertyValue(MSBuildFacts.LegacyTargetFrameworkProfileNodeName); diff --git a/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs b/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs index 22042b255..0ce1f052b 100644 --- a/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs +++ b/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs @@ -274,6 +274,7 @@ public static class MSBuildFacts public const string DesignerSubType = "Designer"; public const string CodeSubTypeValue = "Code"; public const string TargetFrameworkNodeName = "TargetFramework"; + public const string TargetFrameworksNodeName = "TargetFrameworks"; public const string OutputTypeNodeName = "OutputType"; public const string GenerateAssemblyInfoNodeName = "GenerateAssemblyInfo"; public const string RequiredTargetFrameworkNodeName = "RequiredTargetFramework"; From 3751dafe62aa75c63d57bd6155b1dd0a8f350f75 Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Wed, 8 Mar 2023 18:45:09 -0800 Subject: [PATCH 04/11] Nuget TFI addition --- .../TargetFrameworkMonikerCollection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs b/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs index a505afa54..f01b8d8e7 100644 --- a/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs +++ b/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs @@ -108,6 +108,14 @@ private static string[] GetNonSdkTargetFramework(IProjectFile file) } const string NonSdkTargetFramework = "TargetFrameworkVersion"; + const string TargetFrameworkIdentifier = "TargetFrameworkIdentifier"; + + var tfi = file.GetPropertyValue(TargetFrameworkIdentifier); + if (tfi == FrameworkConstants.FrameworkIdentifiers.MonoAndroid || tfi == FrameworkConstants.FrameworkIdentifiers.XamarinIOs) + { + var tf = tfi == FrameworkConstants.FrameworkIdentifiers.MonoAndroid ? "net6.0-android" : "net6.0-ios"; + return new string[] { tf }; + } var tfms = GetTfms(file, NonSdkTargetFramework); From f883c3ab3dd45efb05b0eb1d9c396f2f932a3d0b Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Fri, 10 Mar 2023 09:10:16 -0800 Subject: [PATCH 05/11] Fix typo for recommended net7-ios on MauiiOS projects --- .../MauiTargetFrameworkSelectorFilter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/MauiTargetFrameworkSelectorFilter.cs b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/MauiTargetFrameworkSelectorFilter.cs index 80192065b..118ad9f07 100644 --- a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/MauiTargetFrameworkSelectorFilter.cs +++ b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/MauiTargetFrameworkSelectorFilter.cs @@ -49,7 +49,7 @@ public void Process(ITargetFrameworkSelectorFilterState tfm) } else if (tfm.Components.HasFlag(ProjectComponents.MauiiOS)) { - _logger.LogInformation("Recommending TFM {TFM} for project {Name} because project is of type .NET MAUI Target:iOS", TargetFrameworkMoniker.Net70_Android, tfm.Project); + _logger.LogInformation("Recommending TFM {TFM} for project {Name} because project is of type .NET MAUI Target:iOS", TargetFrameworkMoniker.Net70_iOS, tfm.Project); tfm.TryUpdate(TargetFrameworkMoniker.Net70_iOS); } else if (tfm.Components.HasFlag(ProjectComponents.Maui)) From d18f4d82a7830bca2859382c47b9a349f5b57403 Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Mon, 13 Mar 2023 14:32:02 -0700 Subject: [PATCH 06/11] Add default platform versions --- .../TargetFrameworkMoniker.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs b/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs index 10c9c3212..1ba8881de 100644 --- a/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs +++ b/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs @@ -61,6 +61,8 @@ public static class Platforms private static class DefaultVersions { public static readonly Version Windows = new(7, 0, 0, 0); + public static readonly Version Android = new(31, 0); + public static readonly Version IOS = new(13, 5); } #pragma warning restore CA1034 // Nested types should not be visible @@ -206,6 +208,8 @@ private string ToString(bool includeDefaultPlatformVersion) var defaultVersion = platform switch { Platforms.Windows => DefaultVersions.Windows, + Platforms.Android => DefaultVersions.Android, + Platforms.IOS => DefaultVersions.IOS, _ => null, }; From 706e6094914ff820b2ea845604fdf966afded7be Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Tue, 14 Mar 2023 08:14:07 -0700 Subject: [PATCH 07/11] Revert "Removed LogError call used for debugging" from tfm branch This reverts commit 91dd355a1917026e483f32355dfdb5ac1130abb9. --- .../VisualStudioFinder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index 702b56fcf..6c01a7b2d 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -43,6 +43,8 @@ public void Configure(WorkspaceOptions options) return default; } + _logger.LogError("InstallationPath:{InstallPath}  Version:{Version}", latest.InstallPath, latest.Version); + if (Directory.Exists(latest.InstallPath)) { _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", latest.Version, latest.InstallPath); From 03516b5d95ae49738879b679c83934f2becde20a Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Tue, 14 Mar 2023 08:20:53 -0700 Subject: [PATCH 08/11] Revert "Fixed memory corruption in VisualStudioFinder" This reverts commit ab1f8ef0f1ffcb7952a411719669c4a565775b43. --- .../VisualStudioFinder.cs | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index 6c01a7b2d..6e2e39563 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -35,34 +35,35 @@ public void Configure(WorkspaceOptions options) private (string? Path, int? Version) GetLatestVisualStudioPath(string? suppliedPath) { - var latest = GetLatestVisualStudio(suppliedPath); + var latest = GetLatestPath(suppliedPath); - if (latest.InstallPath is null) + if (latest is null) { _logger.LogWarning("Did not find a Visual Studio instance"); return default; } - _logger.LogError("InstallationPath:{InstallPath}  Version:{Version}", latest.InstallPath, latest.Version); + var version = Version.Parse(latest.GetInstallationVersion()); + var installation = latest.GetInstallationPath(); - if (Directory.Exists(latest.InstallPath)) + if (Directory.Exists(installation)) { - _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", latest.Version, latest.InstallPath); + _logger.LogDebug("Using Visual Studio v{VsVersion} [{VsPath}]", version, installation); - return (latest.InstallPath, latest.Version.Major); + return (installation, version?.Major); } else { - _logger.LogWarning("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", latest.Version, latest.InstallPath); + _logger.LogWarning("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", version, installation); return default; } } - private (string? InstallPath, Version Version) GetLatestVisualStudio(string? suppliedPath) + private ISetupInstance2? GetLatestPath(string? suppliedPath) { + var result = default(ISetupInstance2); var resultVersion = new Version(0, 0); - string? resultPath = null; try { @@ -106,19 +107,17 @@ public void Configure(WorkspaceOptions options) if (instanceHasMSBuild && instance is not null) { - var installPath = instance.GetInstallationPath(); - - if (suppliedPath is not null && string.Equals(suppliedPath, installPath, StringComparison.OrdinalIgnoreCase)) + if (suppliedPath is not null && string.Equals(suppliedPath, instance.GetInstallationPath(), StringComparison.OrdinalIgnoreCase)) { _logger.LogTrace("Identified supplied path for Visual Studio v{Version} [{Path}]", version, instance.GetInstallationPath()); - return (installPath, version); + return instance; } else if (version > resultVersion) { _logger.LogTrace("Found Visual Studio v{Version} [{Path}]", version, instance.GetInstallationPath()); - resultPath = installPath; + result = instance; resultVersion = version; } } @@ -134,7 +133,7 @@ public void Configure(WorkspaceOptions options) // This is OK, VS "15" or greater likely not installed. } - return (resultPath, resultVersion); + return result; } private static ISetupConfiguration GetQuery() From 459b8910f72738b29e52008b324cb82637be011e Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Wed, 15 Mar 2023 10:22:49 -0700 Subject: [PATCH 09/11] update mobile dev logic + remove defaults --- .../TargetFrameworkMoniker.cs | 4 ---- .../TargetFrameworkMonikerCollection.cs | 9 ++++++--- .../MSBuild.Abstractions/ProjectExtensions.cs | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs b/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs index 1ba8881de..10c9c3212 100644 --- a/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs +++ b/src/common/Microsoft.DotNet.UpgradeAssistant.Abstractions/TargetFrameworkMoniker.cs @@ -61,8 +61,6 @@ public static class Platforms private static class DefaultVersions { public static readonly Version Windows = new(7, 0, 0, 0); - public static readonly Version Android = new(31, 0); - public static readonly Version IOS = new(13, 5); } #pragma warning restore CA1034 // Nested types should not be visible @@ -208,8 +206,6 @@ private string ToString(bool includeDefaultPlatformVersion) var defaultVersion = platform switch { Platforms.Windows => DefaultVersions.Windows, - Platforms.Android => DefaultVersions.Android, - Platforms.IOS => DefaultVersions.IOS, _ => null, }; diff --git a/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs b/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs index f01b8d8e7..6773519f2 100644 --- a/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs +++ b/src/extensions/nuget/Microsoft.DotNet.UpgradeAssistant.Extensions.NuGet/TargetFrameworkMonikerCollection.cs @@ -111,10 +111,13 @@ private static string[] GetNonSdkTargetFramework(IProjectFile file) const string TargetFrameworkIdentifier = "TargetFrameworkIdentifier"; var tfi = file.GetPropertyValue(TargetFrameworkIdentifier); - if (tfi == FrameworkConstants.FrameworkIdentifiers.MonoAndroid || tfi == FrameworkConstants.FrameworkIdentifiers.XamarinIOs) + if (tfi == FrameworkConstants.FrameworkIdentifiers.MonoAndroid) { - var tf = tfi == FrameworkConstants.FrameworkIdentifiers.MonoAndroid ? "net6.0-android" : "net6.0-ios"; - return new string[] { tf }; + return new string[] { "net7.0-android" }; + } + else if (tfi == FrameworkConstants.FrameworkIdentifiers.XamarinIOs) + { + return new string[] { "net7.0-ios" }; } var tfms = GetTfms(file, NonSdkTargetFramework); diff --git a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs index 8bf6a91c1..07e9c47f3 100644 --- a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs +++ b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs @@ -50,8 +50,8 @@ public static string GetTargetFramework(this IProject project) ".NETCore" => "net", // UWP ".NETCoreApp" => "netcoreapp", ".NETPortable" => "netstandard", - "MonoAndroid" => "net6.0-android", - "Xamarin.iOS" => "net6.0-ios", + "MonoAndroid" => "net7.0-android", + "Xamarin.iOS" => "net7.0-ios", _ => throw new InvalidOperationException($"Unknown {MSBuildFacts.LegacyTargetFrameworkPropertyNodeName}: {tfi}"), }; From 492dbb8d73f21d5e07f03cf519ec48e08375f3f6 Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Thu, 16 Mar 2023 13:12:23 -0700 Subject: [PATCH 10/11] Update package mapper to include App Center packages + update Community Toolkit to latest --- .../PackageMaps/XamarinPackageMap.json | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json index 539c74b8f..85a9b3893 100644 --- a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json +++ b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json @@ -306,8 +306,12 @@ "NetCorePackages": [] }, { - "PackageSetName": "Third Party Unsupported", + "PackageSetName": "Microsoft.AppCenter", "NetFrameworkPackages": [ + { + "Name": "Microsoft.AppCenter", + "Version": "*" + }, { "Name": "Microsoft.AppCenter.Analytics", "Version": "*" @@ -315,9 +319,30 @@ { "Name": "Microsoft.AppCenter.Crashes", "Version": "*" + }, + { + "Name": "Microsoft.AppCenter.Distribute", + "Version": "*" } ], - "NetCorePackages": [] + "NetCorePackages": [ + { + "Name": "Microsoft.AppCenter", + "Version": "5.0.1" + }, + { + "Name": "Microsoft.AppCenter.Analytics", + "Version": "5.0.1" + }, + { + "Name": "Microsoft.AppCenter.Crashes", + "Version": "5.0.1" + }, + { + "Name": "Microsoft.AppCenter.Distribute", + "Version": "5.0.1" + } + ] }, { "PackageSetName": "Community Toolkit", @@ -331,7 +356,7 @@ { "Name": "CommunityToolkit.Maui", - "Version": "1.0.0-rc2" + "Version": "5.0.0" } ] }, From cf80fffad962c5337a9ed07185e329048c62906b Mon Sep 17 00:00:00 2001 From: Diana Soltani Date: Thu, 16 Mar 2023 15:19:47 -0700 Subject: [PATCH 11/11] Clean up code + update SkiaSharp --- .../PackageMaps/XamarinPackageMap.json | 6 +++--- .../try-convert/MSBuild.Abstractions/ProjectExtensions.cs | 3 ++- .../try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json index 85a9b3893..e6465d371 100644 --- a/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json +++ b/src/extensions/maui/Microsoft.DotNet.UpgradeAssistant.Extensions.Maui/PackageMaps/XamarinPackageMap.json @@ -379,15 +379,15 @@ "NetCorePackages": [ { "Name": "SkiaSharp.Views.Maui.Controls", - "Version": "2.88.0-preview.256" + "Version": "2.88.3" }, { "Name": "SkiaSharp.Views.Maui.Core", - "Version": "2.88.0-preview.256" + "Version": "2.88.3" }, { "Name": "SkiaSharp.Views.Maui.Controls.Compatibility", - "Version": "2.88.0-preview.256" + "Version": "2.88.3" } ] } diff --git a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs index 07e9c47f3..d6dc399b8 100644 --- a/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs +++ b/src/extensions/try-convert/MSBuild.Abstractions/ProjectExtensions.cs @@ -68,7 +68,8 @@ public static string GetTargetFramework(this IProject project) } } } - else if (tfi == "MonoAndroid" || tfi == "Xamarin.iOS") + else if (tfi.Equals(MSBuildFacts.MonoAndroid, StringComparison.OrdinalIgnoreCase) || + tfi.Equals(MSBuildFacts.XamariniOS, StringComparison.OrdinalIgnoreCase)) { return tf; } diff --git a/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs b/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs index 0ce1f052b..c19d91a3a 100644 --- a/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs +++ b/src/extensions/try-convert/MSBuild.Conversion.Facts/MSBuildFacts.cs @@ -302,6 +302,8 @@ public static class MSBuildFacts public const string PackagesSubstring = @"\packages"; public const string NetStandard20 = "netstandard2.0"; public const string NetCoreApp31 = "netcoreapp3.1"; + public const string XamariniOS = "Xamarin.iOS"; + public const string MonoAndroid = "MonoAndroid"; public const string Net5 = "net5.0"; public const string WindowsSuffix = "-windows"; public const string Net5Windows = "net5.0-windows";