Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,4 @@ Copyright (c) .NET Foundation. All rights reserved.
<OutputPath>$(OutputPath)$(TargetFramework.ToLowerInvariant())\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<DisableWinExeOutputInference Condition="'$(DisableWinExeOutputInference)' == '' and ('$(TargetFrameworkIdentifier)' != '.NETCoreApp' or $([MSBuild]::VersionLessThan('$(TargetFrameworkVersion)', '5.0')))">true</DisableWinExeOutputInference>
<OutputType Condition="'$(DisableWinExeOutputInference)' != 'true' and '$(OutputType)' == 'Exe' and ('$(UseWindowsForms)' == 'true' or '$(UseWPF)' == 'true')">WinExe</OutputType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -97,37 +97,6 @@ public void It_errors_on_nonwindows_with_a_framework_reference(string desktopFra
.HaveStdOutContaining(Strings.WindowsDesktopFrameworkRequiresWindows);
}

[WindowsOnlyTheory]
[InlineData("net5.0", "TargetPlatformIdentifier", "Windows", "Exe")]
[InlineData("net5.0", "UseWindowsForms", "true", "WinExe")]
[InlineData("netcoreapp3.1", "UseWindowsForms", "true", "Exe")]
[InlineData("net5.0", "UseWPF", "true", "WinExe")]
[InlineData("netcoreapp3.1", "UseWPF", "true", "Exe")]
[InlineData("net5.0", "UseWPF", "false", "Exe")]
[InlineData("netcoreapp3.1", "UseWPF", "false", "Exe")]
public void It_infers_WinExe_output_type(string targetFramework, string propName, string propValue, string expectedOutputType)
{
var testProject = new TestProject()
{
Name = "WinExeOutput",
TargetFrameworks = targetFramework,
IsExe = true,
};
testProject.AdditionalProperties[propName] = propValue;

var asset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFramework + propName + propValue);

var getValuesCommand = new GetValuesCommand(asset, "OutputType");
getValuesCommand
.Execute()
.Should()
.Pass();

var values = getValuesCommand.GetValues();
values.Count.Should().Be(1);
values.First().Should().Be(expectedOutputType);
}

[WindowsOnlyRequiresMSBuildVersionFact("16.8.0")]
public void It_builds_on_windows_with_the_windows_desktop_sdk_5_0_with_ProjectSdk_set()
{
Expand Down