Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure to Install Microsoft.AspNetCore.AppRef

When I tried installing Microsoft.AspNetCore.AppRef in my webapplication in .net core 3.1.

However, I get this error instead:

Package 'Microsoft.AspNetCore.App.Ref 3.1.3' has a package type 'DotnetPlatform' that is not supported by project 'xxxxxx'.             
NU1213 The package Microsoft.AspNetCore.App.Ref 3.1.3 has a package type DotnetPlatform that is incompatible with this project.         

Any ideas how to fix?

like image 268
What'sUP Avatar asked Dec 03 '25 13:12

What'sUP


1 Answers

According to Microsoft Learn, the correct way to reference the ASP.NET Core application assemblies from .NET Core 3.0 on is by adding a FrameworkReference, e.g.

<Project Sdk="Microsoft.NET.Sdk">

  ......

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

</Project>
like image 75
poizan42 Avatar answered Dec 06 '25 23:12

poizan42



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!