使用VS Code 编译C# 为DLL

  1. 1. 新建项目
  2. 2. 修改 csproj
  3. 3. 编译代码
  4. 4. 运行项目
  5. 5. 打包项目

新建项目

1
dotnet new console

修改 csproj

*.csproj文件里面的 OutputType 改成 library

1
<OutputType>library</OutputType>

编译代码

1
dotnet restore 

运行项目

1
dotnet run 

打包项目

1
2
dotnet build -c release
dotnet run -c release
投喂小莫
给快要饿死的小莫投喂点零食吧~
投喂小莫
分享
分享提示信息