diff --git a/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs b/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs index 03115fd..7cd4579 100644 --- a/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs +++ b/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs @@ -263,7 +263,7 @@ public async Task PackageCommandForMauiAppsShouldCallMSBuildIfWindows() ExternalCommandExecutor .Setup(x => x.RunAsync( It.Is(s => s == "dotnet"), - It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -r win10-x64 --self-contained /p:Configuration=Release")), + It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 --self-contained -c Release")), It.Is(s => s == dirInfo.FullName), It.IsAny())) .ReturnsAsync(new Services.ExternalCommandExecutionResult @@ -305,8 +305,8 @@ public async Task PackageCommandForMauiAppsShouldCallMSBuildWithOutputParameterI ExternalCommandExecutor .Setup(x => x.RunAsync( It.Is(s => s == "dotnet"), - It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -r win10-x64 --self-contained /p:Configuration=Release") - && s.Contains($"AppxPackageDir={customPath}\\;") + It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 --self-contained -c Release") + && s.Contains($"AppxPackageDir={customPath}\\") && s.EndsWith($"AppxPackageTestDir={customPath}\\MauiProject_1.0.0.0_X64_Test\\")), It.Is(s => s == dirInfo.FullName), It.IsAny())) diff --git a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs index 38e5906..c461457 100644 --- a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs +++ b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs @@ -250,8 +250,7 @@ await AnsiConsole.Status().StartAsync("Restoring packages...", async ctx => { var runtime = $"win10-{appxBundlePlatform.ToLowerInvariant()}"; - // Maybe switch AppxPackageTestDir to bin\Release\{targetFramework}\{runtime}\AppPackages\? - msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} -r {runtime} --self-contained /p:Configuration=Release;AppxBundle=Always;Platform={appxBundlePlatform};AppxBundlePlatforms={appxBundlePlatform};AppxPackageDir={escapedOutput}\\;UapAppxPackageBuildMode=StoreUpload;GenerateAppxPackageOnBuild=true;AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\"); + msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} -p:RuntimeIdentifierOverride={runtime} --self-contained -c Release -p:AppxBundle=Always -p:AppxBundlePlatforms={appxBundlePlatform} -p:AppxPackageDir={escapedOutput}\\ -p:UapAppxPackageBuildMode=StoreUpload -p:AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\"); } ExternalCommandExecutionResult? result = null;