question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

From @DataTables on Thursday, October 17, 2019 10:16:11 AM

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

Copied from original issue: aspnet/AspNetCore#15107

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dsplaistedcommented, Oct 17, 2019

@KathleenDollard @mhutch Can you help clarify what version of Mono is needed to support the 3.0 SDK?

@DataTables You can use this package to support building projects targeting .NET Framework: https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies/1.0.0-preview.2

0reactions
livarcocccommented, Oct 20, 2019

giving that things are working here now and it does seem like the issue was using an older version of Mono, I am going to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The FrameworkReference was not recognized - .NET CLI
This error typically means there is a version of a particular FrameworkReference that the SDK cannot find. Try deleting your obj and bin ......
Read more >
The FrameworkReference 'Microsoft.AspNetCore.App' was ...
NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized. enter image description here. How to fix it?
Read more >
The FrameworkReference 'Microsoft.AspNetCore.App' was ...
I'm trying to upgrade my library project from .net core 2.2 to .net core 3.0 using below setup for the .csproj netstandard2.0 latest....
Read more >
Can't build app because of The FrameworkReference ...
Can't build app because of The FrameworkReference 'Microsoft.NETCore.App' was not recognized ... App' was not recognized exception in build console
Read more >
Error NETSDK1073: The FrameworkReference 'Microsoft. ...
Error NETSDK1073 : The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073)Closed - Not Enough Info
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found