如何访问 class 库中的 PageRemote 属性

How to access PageRemote attribute in class library

我使用 .NET 6,我想在 class 库中使用 [PageRemote],我在我的 class 库中安装了 Microsoft.AspNetCore.Mvc,但我仍然不能在我的 class 库中使用 [PageRemote]
如何在 class 库中使用 [PageRemote]

尝试将 Asp.Net 核心框架参考添加到您的 class 库中,如下所示: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/target-aspnetcore?view=aspnetcore-6.0&tabs=visual-studio#use-the-aspnet-core-shared-framework