創(chuàng)建目錄
mkdir pro
cd pro
創(chuàng)建解決方案
dotnet new sln
創(chuàng)建類庫
dotnet new classlib -f net6.0 -o StringLibrary
添加到解決方案
dotnet sln add StringLibrary/StringLibrary.csproj
運(yùn)行以下命令創(chuàng)建控制臺應(yīng)用項目:
dotnet new console -f net6.0 -o ShowCase
向解決方案添加控制臺應(yīng)用項目
dotnet sln add ShowCase/ShowCase.csproj
添加類庫項目引用
dotnet add ShowCase/ShowCase.csproj reference StringLibrary/StringLibrary.csproj
運(yùn)行
dotnet run --project ShowCase/ShowCase.csproj