Add KnownFrameworkReference items for .NET 6

Fixes https://github.com/dotnet/sdk/issues/13950
This commit is contained in:
Daniel Plaisted 2020-10-23 13:19:43 -07:00
parent 3c9f9f35dd
commit 2c7d23afe9
2 changed files with 165 additions and 25 deletions

View file

@ -13,6 +13,20 @@ namespace EndToEnd.Tests
{
public class ProjectBuildTests : TestBase
{
// TODO: Once console template is updated to target net6.0, remove this logic
void RetargetProject(string projectDirectory)
{
var projectFile = Directory.GetFiles(projectDirectory, "*.csproj").Single();
var projectXml = XDocument.Load(projectFile);
var ns = projectXml.Root.Name.Namespace;
projectXml.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework").Value = "net6.0";
projectXml.Save(projectFile);
}
[Fact]
public void ItCanNewRestoreBuildRunCleanMSBuildProject()
{
@ -25,6 +39,8 @@ namespace EndToEnd.Tests
.Execute(newArgs)
.Should().Pass();
RetargetProject(projectDirectory);
new RestoreCommand()
.WithWorkingDirectory(projectDirectory)
.Execute()
@ -63,6 +79,8 @@ namespace EndToEnd.Tests
.Execute(newArgs)
.Should().Pass();
RetargetProject(projectDirectory);
string projectPath = Path.Combine(projectDirectory, directory.Name + ".csproj");
var project = XDocument.Load(projectPath);