How to Create NuGet Packages From .Net Core RC2 Cl

2020-02-26 07:10发布

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 there from RC1 is missing.

I can go ahead and create a script that goes to each folder and call "dotnet pack", but is there an option in Visual Studio that I am missing to do this?

2条回答
对你真心纯属浪费
2楼-- · 2020-02-26 07:49

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.

查看更多
该账号已被封号
3楼-- · 2020-02-26 07:50

At this point, I don't believe there is an option to do this automatically in VS. You can look into using NuProj to do this if you like.

查看更多
登录 后发表回答