The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
See original GitHub issueFrom @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:
- Clone into this repo which is the one I’m trying to add .NET Core 3.0 build support to.
- 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>
- 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:
- Created 4 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top GitHub Comments
@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
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.