标签:类库 Core Asp core aspnetcore net
依赖Asp.net Core的类库
用Visual Studio创建的类库想依赖Asp.net Core的某些组件,比如Microsoft.AspNetCore.Mvc.Core,在.netcore 3.1之后不再单独提供nuget包,应该怎么办呢?直接在.csproj文件里面添加FrameworkReference:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
参考
https://stackoverflow.com/questions/59972153/how-to-install-microsoft-aspnetcore-mvc-core-with-version-3-1-0-from-nuget
https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/target-aspnetcore?view=aspnetcore-7.0&tabs=visual-studio#determine-which-aspnet-core-versions-to-support
标签:类库,
Core,
Asp,
core,
aspnetcore,
net
From: https://www.cnblogs.com/tubo/p/17826428.html