Skip to content

Commit 77944c7

Browse files
authored
[Blazor] Treat RuntimeIdentifiers as local property (#50487)
1 parent 0778f5a commit 77944c7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
99
Copyright (c) .NET Foundation. All rights reserved.
1010
***********************************************************************************************
1111
-->
12-
<Project ToolsVersion="14.0" TreatAsLocalProperty="RuntimeIdentifier">
12+
<Project ToolsVersion="14.0" TreatAsLocalProperty="RuntimeIdentifier;RuntimeIdentifiers">
1313
<PropertyGroup>
1414
<OutputType>exe</OutputType>
1515

1616
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
17+
<RuntimeIdentifiers>$(RuntimeIdentifier)</RuntimeIdentifiers>
1718
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
1819
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
1920

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,23 @@ public class TestReference
697697
fileInWwwroot.Should().Exist();
698698
}
699699

700+
[RequiresMSBuildVersionFact("17.12", Reason = "Needs System.Text.Json 8.0.5")]
701+
public void Restore_WithRuntime_Works()
702+
{
703+
var testInstance = CreateAspNetSdkTestAsset("BlazorHosted");
704+
705+
var nugetRestorePath = Path.Combine(testInstance.TestRoot, ".nuget");
706+
707+
new DotnetRestoreCommand(Log, "-bl:msbuild-restore.binlog", "-r", "linux-x64")
708+
.WithWorkingDirectory(Path.Combine(testInstance.TestRoot, "blazorhosted"))
709+
.WithEnvironmentVariable("NUGET_PACKAGES", nugetRestorePath)
710+
.Execute()
711+
.Should().Pass();
712+
713+
new DirectoryInfo(Path.Combine(nugetRestorePath, "microsoft.netcore.app.runtime.mono.linux-x64"))
714+
.Should().NotExist();
715+
}
716+
700717
[RequiresMSBuildVersionFact("17.12", Reason = "Needs System.Text.Json 8.0.5")]
701718
public void Build_WithReference_Works()
702719
{

0 commit comments

Comments
 (0)