Using Microsoft.AspNetCore.All package in netstandard

前端 未结 2 1845
失恋的感觉
失恋的感觉 2021-01-11 13:30

At the moment I\'m porting an asp web api to .Net Core.

The api uses a Class library which provides some implementations of the ActionFilterAttribute class.

2条回答
  •  忘掉有多难
    2021-01-11 13:42

    The metapackage Microsoft.AspNetCore.All is only available for .NETCoreApp. This is by design since its explictly targeted as a convenience package for web applications running on .NET Core. In order to work its magic at publishing time (stripping of unused dependencies), it requires the .NET Core runtime store which is only available for .NET Core itself.

    All other projects, including library projects running on .NET Standard but also including all projects that run on the full .NET Framework, should use individual package references instead.

    So instead of referencing Microsoft.AspNetCore.All, you would be referencing e.g. Microsoft.AspNetCore, or Microsoft.AspNetCore.Mvc to get your ActionFilterAttribute.

提交回复
热议问题