依赖Asp.net Core的类库
依赖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>