Skip to content

RID-specific self-contained .NET Core 3 app with dependency on Microsoft.NETCore.App 2.0.0 fails to run #3582

@dsplaisted

Description

@dsplaisted

Repro

Build and run the following project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
    <SelfContained>false</SelfContained>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NETCore.App" Version="2.0.0" />
  </ItemGroup>
</Project>

Expected

Project runs successfully

Actual

Project fails to run with error messages such as the following:

  • A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.0.0-preview9.19416.11'.

  • The specified framework 'Microsoft.NETCore.App', version '3.0.0-preview9-19409-16' was not found.

The output folder also includes the following files, which come from the Microsoft.NETCore.App 2.0.0 package closure:

  • apphost.exe
  • hostfxr.dll
  • hostpolicy.dll
  • System.Private.CoreLib.dll

Details

NuGet/Home#7344 would fix this. Alternatively, we could try to use conflict resolution to exclude these extra assets. That would probably require updating the platform manifest in the targeting pack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions