Rob Bowman
Rob Bowman

Reputation: 8711

Downgrade from Core 3 to 2 then Microsoft.AspNetCore.App not recognised

I have VS2019 v16.3.5 installed along with the dotnet core 3 sdk. I can browse to C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App and see lots of the versions of the shared framework in folders from 2.1.9 to 3.0.0

To reproduce the problem:

<ItemGroup>
 <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

At this point it works ok but then:

I get the build error:

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

Should it be possible to target 2.2 and still use the shared framework Microsoft.AspNetCore.App?

Upvotes: 0

Views: 3340

Answers (1)

TanvirArjel
TanvirArjel

Reputation: 32069

FrameworkReference is a new feature of ASP.NET Core 3.0. Not available in the lower versions. For lower versions replace <FrameworkReference Include="Microsoft.AspNetCore.App" /> with the following:

<PackageReference Include="Microsoft.AspNetCore.App" />

Upvotes: 2

Related Questions