How to Create NuGet Packages From .Net Core RC2 Class Libraries

前端 未结 2 2095
不知归路
不知归路 2020-12-31 08:04

I have a solution in Visual Studio with 12 projects. I would like to create a nuget package from Visual Studio, but it appears the \"Produce outputs on build\" that was ther

2条回答
  •  死守一世寂寞
    2020-12-31 08:51

    Add this to your project.json file:

    "scripts": {
      "postcompile": [
        "dotnet pack --no-build --configuration %compile:Configuration%"
      ]
    }
    

    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'm not sure how to only do this in release mode, so I've asked that question here.

    UPDATE

    Updated the answer based on the other question.

提交回复
热议问题