Skip to content

Metadata for implicitly included references is thrown away #10929

Open
@davkean

Description

@davkean

Build the following project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net45</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Reference Update="System">
      <Aliases>FirstAlias, SecondAlias</Aliases>
      <Private>true</Private>
    </Reference>
  </ItemGroup>

</Project>
extern alias FirstAlias;
extern alias SecondAlias;

Expected: For it to build and for System.dll to be copied to the output directory
Actual:

Errors building because the aliases don't exist and the dll is not copied to the output directory if you remove the aliases:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0430	The extern alias 'FirstAlias' was not specified in a /reference option	ConsoleApp218	C:\Users\davkean\source\repos\ConsoleApp218\ConsoleApp218\Program.cs	1	Active
Error	CS0430	The extern alias 'SecondAlias' was not specified in a /reference option	ConsoleApp218	C:\Users\davkean\source\repos\ConsoleApp218\ConsoleApp218\Program.cs	2	Active

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions