Skip to content

The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized #15107

@ghost

Description

Describe the bug

When adding .NET Core 3.0 to a multi-targeted project I'm getting the error:

error NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized

I've followed the porting guide here but have been unable to resolve the issue. It looks like this also also been raised in other issues, but the indications there are that this was an issue during the previews and should now be resolved.

To Reproduce

Steps to reproduce the behavior:

  1. Clone into this repo which is the one I'm trying to add .NET Core 3.0 build support to.
  2. Update the DataTables-Editor-Server.csproj file to target .NET Core 3.0:
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net45;net46;net47</TargetFrameworks>

and add:

  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.CSharp">
      <Version>4.6.0</Version>
    </PackageReference>
  </ItemGroup>
  1. Run msbuild DataTables.sln - observe errors for .NET Core 3.0 build.

The documentation here notes that Microsoft.AspNetCore.App" is implicit and doesn't need to be included, but the migration guide says it should if the SDK is Microsoft.NET.Sdk which I've been using.

Expected behavior

dll targeting .NET Core 3.0 will be build along with the others.

Additional context

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     fedora
 OS Version:  27
 OS Platform: Linux
 RID:         fedora.27-x64
 Base Path:   /usr/share/dotnet/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  95a0a61858

.NET Core SDKs installed:
  2.1.505 [/usr/share/dotnet/sdk]
  3.0.100 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Installation for .NET Core (and Framework via mono) build in Fedora was:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
wget -q https://packages.microsoft.com/config/fedora/27/prod.repo
sudo mv prod.repo /etc/yum.repos.d/microsoft-prod.repo
sudo chown root:root /etc/yum.repos.d/microsoft-prod.repo

sudo dnf install -y aspnetcore-runtime-2.1
sudo dnf install -y dotnet-sdk-2.1-2.1.505

sudo dnf install -y aspnetcore-runtime-3.0
sudo dnf install -y dotnet-sdk-3.0

# .NET Framework via Mono
sudo rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
sudo curl https://download.mono-project.com/repo/centos7-stable.repo | sudo tee /etc/yum.repos.d/mono-centos7-stable.repo
sudo dnf install -y mono-devel mono-complete xsp msbuild

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions