Using Microsoft.AspNetCore.All package in netstandard

前端 未结 2 1832
失恋的感觉
失恋的感觉 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:46

    You can't (well technically you could via NuGet Fallback, but you shouldn't as it may affect your portability) and you shouldn't.

    The .All package is a convenience meta-package, so you don't need to reference a dozen or other assemblies for even the simplest ASP.NET Core Project.

    It's targeting .NET Core for a reason, so you can't use it in .NET Standard.

    When you publish your application, the unused packages will be stripped off. When doing a class library you don't want dependency on everything but only the packages which are required by your project.

提交回复
热议问题