forked from LILIXZ/example_package_managers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.csproj
38 lines (30 loc) · 1.18 KB
/
package.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<!-- 1. 添加 NuGet 包依赖项 -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- 2. 添加 NuGet 包依赖项并指定 PrivateAssets -->
<PackageReference Include="Serilog" Version="2.11.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- 3. 添加 NuGet 包依赖项并指定 IncludeAssets -->
<PackageReference Include="AutoMapper" Version="11.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<!-- 4. 添加项目引用 -->
<ProjectReference Include="..\OtherProject\OtherProject.csproj" />
</ItemGroup>
<ItemGroup>
<!-- 5. 添加框架引用 -->
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
<!-- 6. 添加条件编译依赖项 -->
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
</ItemGroup>
</Project>