Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bdd78a6
Adds an item group, outputProperties, which defaults to TargetFramewo…
Jun 11, 2020
cdfd098
Update src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.…
laurenprinn Jun 15, 2020
028f74a
Changing the LogOutputProperties item to be similar to a key-value pa…
Jun 24, 2020
87a401f
Changed item name to be more descriptive to its purpose
Jun 26, 2020
b07748b
Renaming item
Jul 6, 2020
28ffa1e
Update src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.…
laurenprinn Jul 23, 2020
175acfb
Update src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.…
laurenprinn Jul 23, 2020
31ef8f6
:qd
Jul 30, 2020
ce58d6b
Test to check if by default TargetFramework is printed in logger if T…
Aug 14, 2020
16bedf9
Merge remote-tracking branch 'upstream/master' into outputProperties_…
Aug 14, 2020
0d04c66
Update ProjectConfigurationDescriptionTest.cs
laurenprinn Jun 10, 2021
a044fd0
Merge remote-tracking branch 'upstream/release/6.0.2xx' into outputPr…
rainersigwald Jan 14, 2022
db3d929
Merge remote-tracking branch 'upstream/release/6.0.3xx' into outputPr…
rainersigwald Feb 9, 2022
7a6ca86
Merge remote-tracking branch 'upstream/main' into outputProperties_it…
rainersigwald May 9, 2022
91cb9b0
Adapt unit test to new format
rainersigwald May 10, 2022
86a4f0b
Delete extra copy of test file
rainersigwald May 10, 2022
f5c83c1
Undo whitespace changes
rainersigwald Jun 7, 2022
b00ae4e
Copyright header for new test file
rainersigwald Jun 8, 2022
e5987b8
Test needs MSBuild 17.2+
rainersigwald Jun 22, 2022
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 @@ -50,6 +50,10 @@ Copyright (c) .NET Foundation. All rights reserved.
<GenerateRuntimeConfigurationFilesInputs Include="$(UserRuntimeConfig)" Condition=" Exists($(UserRuntimeConfig)) " />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworks)' != '' And '$(TargetFramework)' != ''">
<ProjectConfigurationDescription Include="TargetFramework=$(TargetFramework)" />
</ItemGroup>

<PropertyGroup Condition="'$(GenerateRuntimeConfigDevFile)' == ''">
<GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>
<!-- Post-net6.0, stop generating *.runtimeconfig.dev.json files to reduce probing paths. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System.IO;
using Microsoft.NET.TestFramework;
using Microsoft.NET.TestFramework.Assertions;
using Microsoft.NET.TestFramework.Commands;
using FluentAssertions;
using Microsoft.NET.TestFramework.ProjectConstruction;
using Xunit.Abstractions;
using Xunit;

namespace Microsoft.NET.Build.Tests
{
public class ProjectConfigurationDescription : SdkTest
{
public ProjectConfigurationDescription(ITestOutputHelper log) : base(log)
{
}

[Fact]
public void ProjectConfigurationDescription_DefaultTest()
{
const string errorTargetFramework = "net48";

var testProj = new TestProject()
{
Name = "MultitargetingConfigurationDescription",
TargetFrameworks = $"{ToolsetInfo.CurrentTargetFramework};{errorTargetFramework}",
IsExe = true,
IsSdkProject = true
};

var testAsset = _testAssetsManager.CreateTestProject(testProj);
File.WriteAllText(Path.Combine(testAsset.Path, testProj.Name, $"{testProj.Name}.cs"), @"
using System;
class Program
{
static void Main(string[] args)
{
#if NET472_OR_GREATER
Consol.WriteLine(""NET472"");
#endif
#if NETCOREAPP
Console.WriteLine(""NETCOREAPP"");
#endif
}
}");

var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name));
buildCommand
.Execute()
.Should()
.Fail()
.And
.HaveStdOutContaining($"::TargetFramework={errorTargetFramework}");
}
}
}