更新时间:2023-02-09 09:35:03
将此添加到您的 project.json
文件中:
Add this to your project.json
file:
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration %compile:Configuration%"
]
}
这将运行 dotnet pack
命令将打包编译成NuGet包后生成的生成输出。有关更多信息,请参见此。
This will run the dotnet pack
command which will pack your build output produced after compilation into a NuGet package. For more info, see this.
I'我不确定如何仅在发布模式下执行此操作,所以我问了这个问题此处。
I'm not sure how to only do this in release mode, so I've asked that question here.
更新
根据其他问题更新了答案。
Updated the answer based on the other question.