I use .NET 6 and I want to use [PageRemote]
in class library, I installed Microsoft.AspNetCore.Mvc
in my class library, but still I can't use [PageRemote]
in my class library.
How can I use [PageRemote]
in class libraries?
Try adding the ASP.NET Core framework reference into your class library as is shown here:
To reference ASP.NET Core, add the following
<FrameworkReference>
element to your project file:<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup> </Project>