diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index b2551a1c7251..0b96f304229e 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -132,6 +132,18 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + AnyCPU + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props index ccb497097cd2..581655a9fb70 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props @@ -57,6 +57,8 @@ Copyright (c) .NET Foundation. All rights reserved. + AnyCPU <_PlatformWithoutConfigurationInference>$(Platform) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPreserveCompilationContext.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPreserveCompilationContext.cs index 1b4b5eaabcab..9314ebfbf9de 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPreserveCompilationContext.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPreserveCompilationContext.cs @@ -103,7 +103,7 @@ public void It_publishes_the_project_with_a_refs_folder_and_correct_deps_file(st dependencyContext.CompilationOptions.Defines.Should().Contain(expectedDefines); dependencyContext.CompilationOptions.LanguageVersion.Should().Be(langVersion); - dependencyContext.CompilationOptions.Platform.Should().Be("x86"); + dependencyContext.CompilationOptions.Platform.Should().Be(appTargetFramework == "net46" ? "x86" : "AnyCPU"); dependencyContext.CompilationOptions.Optimize.Should().Be(false); dependencyContext.CompilationOptions.KeyFile.Should().Be(""); dependencyContext.CompilationOptions.EmitEntryPoint.Should().Be(true);