avatar
童琦杰
Oct 15, 2023Technology

.NET CLI

创建Solution文件,文件名为demo-solution.sln

bash
dotnet new sln --name demo-solution

创建src目录

bash
mkdir src

创建Console应用项目作为App入口

bash
dotnet new console --output src/DemoSolution.WebApp --framework net6.0 --use-program-main

将Console应用添加到Solution中

bash
dotnet sln demo-solution.sln add src/DemoSolution.WebApp

添加依赖包

bash
dotnet add src/DemoSolution.WebApp package package-name --version 1.0.0

配置文件夹输出

xml
<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <None Include="Configuration\**\*;">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
</Project>
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号