From 593e11008d49dc9a1b375d197b25e458299568be Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 6 Sep 2022 11:01:59 -0500 Subject: [PATCH] [One .NET] fix `dotnet run -c Release` Context: https://github.com/dotnet/xamarin/issues/26 The following does not work as expected: dotnet new android dotnet run -c Release You end up with a `Debug` app in this case. The way we implemented `dotnet run` was to make `$(RunCommand)` and `$(RunArguments)` invoke `dotnet build -t:Run`. We were losing the `$(Configuration)` value in this example. --- .../targets/Microsoft.Android.Sdk.Application.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets index ef36b33fc11..96dfb705f95 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets @@ -13,7 +13,7 @@ This file contains targets specific for Android application projects. <_RuntimeIdentifierUsesAppHost>false dotnet - build "$(MSBuildProjectFullPath)" -target:Run + build "$(MSBuildProjectFullPath)" -target:Run --configuration "$(Configuration)" <_RunDependsOn Condition=" '$(_XASupportsFastDev)' == 'true' ">