Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where ASP.NET PackageReferences with implicit versions had incorrect PrivateAssets value #2581

Merged
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 @@ -97,12 +97,12 @@ Copyright (c) .NET Foundation. All rights reserved.
<ItemGroup>
<!-- Set implicit metadata on ASP.NET package references -->
<PackageReference Update="Microsoft.AspNetCore.App">
<PrivateAssets Condition="'%(PackageReference.Version)' == ''">true</PrivateAssets>
<PrivateAssets Condition="'%(PackageReference.Version)' == ''">all</PrivateAssets>
<Publish Condition="'%(PackageReference.Version)' == ''">true</Publish>
</PackageReference>

<PackageReference Update="Microsoft.AspNetCore.All">
<PrivateAssets Condition="'%(PackageReference.Version)' == ''">true</PrivateAssets>
<PrivateAssets Condition="'%(PackageReference.Version)' == ''">all</PrivateAssets>
<Publish Condition="'%(PackageReference.Version)' == ''">true</Publish>
</PackageReference>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,27 @@ public void Packing_a_netcoreapp_2_0_app_does_not_include_the_implicit_dependenc
dependencies.Should().BeEmpty();
}

[Theory]
[InlineData("Microsoft.AspNetCore.App")]
[InlineData("Microsoft.AspNetCore.All")]
public void Package_an_aspnetcore_2_1_app_does_not_include_the_implicit_dependency(string packageId)
{
TestProject testProject = new TestProject()
{
Name = "PackAspNetCoreApp21App",
IsSdkProject = true,
TargetFrameworks = "netcoreapp2.1",
IsExe = true
};

testProject.PackageReferences.Add(new TestPackageReference(packageId, ""));

var dependencies = PackAndGetDependencies(testProject);

dependencies.Should().BeEmpty();

}

[Fact]
public void Packing_a_netcoreapp_2_0_DotnetCliTool_app_includes_the_implicit_dependency()
{
Expand Down