Skip to content

Alias in ProjectReference does not work for framework-included packages #15443

Open
@aortiz-msft

Description

@aortiz-msft

Issue moved from NuGet/Home#10438


From @weltkante on Friday, January 8, 2021 4:19:41 PM

Details about Problem

In #4989 alias support for PackageReference was added, but when I try to create an alias to a framework-provided package this does not appear to work.

In particular, in a .NET 5 web application I add

<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" Aliases="logging" />

but extern alias logging; does not compile:

error CS0430: Der externe Alias "logging" wurde nicht in einer /reference-Option angegeben.

If I instead do it in a console application it indeed does work.

Using VS 2019 Update 9 Preview 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions