diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs index acba5758144c..244c80105494 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs @@ -34,10 +34,11 @@ public void It_errors_when_missing_windows_target_platform(string propertyName) testProject.AdditionalProperties[propertyName] = "true"; testProject.AdditionalProperties["TargetPlatformIdentifier"] = "custom"; // Make sure we don't get windows implicitly set as the TPI testProject.AdditionalProperties["TargetPlatformSupported"] = "true"; + testProject.AdditionalProperties["TargetPlatformMoniker"] = "custom,Version="; //Make sure we avoid implicitly setting an invalid TPV var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: propertyName); var buildCommand = new BuildCommand(testAsset); - buildCommand.Execute() + buildCommand.ExecuteWithoutRestore() .Should() .Fail() .And