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 @@ -85,6 +85,10 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- This will turn off the base UWP-specific 'ResolveNuGetPackages' target -->
<ResolveNuGetPackages>false</ResolveNuGetPackages>

<!-- Skip import of Microsoft.NuGet.props and Microsoft.NuGet.targets -->
<SkipImportNuGetProps>true</SkipImportNuGetProps>
<SkipImportNuGetBuildTargets>true</SkipImportNuGetBuildTargets>

<!-- NuGet should always restore .NET SDK projects with "PackageReference" style restore. Setting this property will
cause the right thing to happen even if there aren't any PackageReference items in the project, such as when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,36 @@ public void It_targets_the_right_shared_framework(string targetFramework, string
var netCoreAppLibrary = target.Libraries.Single(l => l.Name == "Microsoft.NETCore.App");
netCoreAppLibrary.Version.ToString().Should().Be(expectedPackageVersion);
}

[Fact]
public void It_restores_only_ridless_tfm()
{
// Disable this test when using full Framework MSBuild, until MSBuild is updated
// to provide conditions in NuGet ImportBefore/ImportAfter props/targets
// https://github.com/dotnet/sdk/issues/874
if (UsingFullFrameworkMSBuild)
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("HelloWorld")
.WithSource()
.Restore();

var getValuesCommand = new GetValuesCommand(Stage0MSBuild, testAsset.TestRoot,
"netcoreapp1.0", "TargetDefinitions", GetValuesCommand.ValueType.Item);

getValuesCommand
.Execute()
.Should()
.Pass();

// When RuntimeIdentifier is not specified, the assets file
// should only contain one target with no RIDs
var targetDefs = getValuesCommand.GetValues();
targetDefs.Count.Should().Be(1);
targetDefs.Should().Contain(".NETCoreApp,Version=v1.0");
}
}
}