From 2d14167b380497732825ec4d161959d5852496b4 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jan 2024 08:17:57 -0600 Subject: [PATCH 1/5] [tests] use `dotnet/maui/net9.0` branch The `MAUI Integration` test lane is currently failing with: Unhandled exception: Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestCompositionException: Could not find workload 'microsoft-net-runtime-android-net8' extended by workload 'android' in manifest 'microsoft.net.sdk.android' [C:\a\_work\1\s\maui\bin\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\WorkloadManifest.json] at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.<>c__DisplayClass26_0.<g__EnumerateWorkloadWithExtendsRec|0>d.MoveNext() at System.Linq.Enumerable.AppendPrependIterator`1.LoadFromEnumerator() at System.Linq.Enumerable.AppendPrepend1Iterator`1.MoveNext() at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate) at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetAvailableWorkloadDefinitions()+MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer) at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.ValidateWorkloadIdsInput() at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolverFactory workloadResolverFactory, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String tempDirPath, IReadOnlyCollection`1 workloadIds) at Microsoft.DotNet.Cli.WorkloadInstallCommandParser.<>c.b__6_0(ParseResult parseResult) at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) C:\a\_work\1\s\maui\src\DotNet\DotNet.csproj(198,5): error MSB3073: The command ""C:\a\_work\1\s\maui\bin/dotnet/dotnet" workload install android --skip-sign-check --skip-manifest-update --verbosity diag --temp-dir "C:\a\_work\1\s\maui\bin/temp/" --configfile "C:\a\_work\1\s\maui\NuGet.config"" exited with code 1. This is likely just due to the fact that it's using the `dotnet/maui/net8.0` branch. Hopefully, switching to the proper branch fixes things. --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 35600efb7db..28477626d98 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -33,7 +33,7 @@ resources: - repository: maui type: github name: dotnet/maui - ref: refs/heads/net8.0 + ref: refs/heads/net9.0 endpoint: xamarin parameters: From ae88141f79e02f181e18414074b2593dee24045d Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jan 2024 09:48:44 -0600 Subject: [PATCH 2/5] Patch $(TargetFrameworks) To avoid failure during `restore`: error NETSDK1139: The target platform identifier ios was not recognized. --- build-tools/automation/azure-pipelines.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 28477626d98..2d1cc37aa2a 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -406,6 +406,13 @@ stages: displayName: Create MAUI template continueOnError: false + - powershell: >- + [xml] $xml = Get-Content $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj + $node = $xml.SelectSingleNode("/Project/PropertyGroup/TargetFrameworks") + $node.Value = $(DotNetTargetFramework)-android + $xml.Save($(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj) + displayName: set TargetFrameworks to Android-only + - template: yaml-templates/run-dotnet-preview.yaml parameters: project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj From 97d33b45fedc90e8b15f6c6ae8dc542b1661c622 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jan 2024 10:42:25 -0600 Subject: [PATCH 3/5] Update azure-pipelines.yaml --- build-tools/automation/azure-pipelines.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 2d1cc37aa2a..598e07100bd 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -407,10 +407,11 @@ stages: continueOnError: false - powershell: >- - [xml] $xml = Get-Content $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj - $node = $xml.SelectSingleNode("/Project/PropertyGroup/TargetFrameworks") - $node.Value = $(DotNetTargetFramework)-android - $xml.Save($(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj) + $project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj' + [xml] $xml = Get-Content $project + $node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks') + $node.Value = '$(DotNetTargetFramework)-android' + $xml.Save($project) displayName: set TargetFrameworks to Android-only - template: yaml-templates/run-dotnet-preview.yaml From 41503378550f5ae976e595a822621482fe71ee35 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jan 2024 13:28:56 -0600 Subject: [PATCH 4/5] Update azure-pipelines.yaml --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 598e07100bd..04920721365 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -406,7 +406,7 @@ stages: displayName: Create MAUI template continueOnError: false - - powershell: >- + - powershell: | $project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj' [xml] $xml = Get-Content $project $node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks') From dfcabfd7902325a8c4b383e6d9895f9d517181df Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jan 2024 14:58:23 -0600 Subject: [PATCH 5/5] `InnerText` because it's an XML element! --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 04920721365..571796a120f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -410,7 +410,7 @@ stages: $project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj' [xml] $xml = Get-Content $project $node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks') - $node.Value = '$(DotNetTargetFramework)-android' + $node.InnerText = '$(DotNetTargetFramework)-android' $xml.Save($project) displayName: set TargetFrameworks to Android-only