1

I want to build my dll, and use dotnet pack to generate *.nupkg file. Then use nuget push to publish my dll.

dotnet pack --no-build

nuget setapikey xxx-xxx-xxx-xxx-xxx -source xxxxxxxxxxxxxxxxxxxxxxx

nuget push yyyyyyyyyyyyyyyyyyyyyyyyy -source xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

So every time I build my project, it automatically generate *.nupkg and publish it.

But I'm stuck in publish. nuget push need to specify the *.nupkg, so how to get the full file name generated by dotnet pack marked green? Now I have to set yyyyyyyyyyyyyyyyyyyyyyyyy every time, it's annoying.

Or is there any way to get package version, so I can build the full file name?

enter image description here

Vincent
  • 3,124
  • 3
  • 21
  • 40

1 Answers1

0

I found a solution that dotnet pack's result to a text file, and then use batch to parse that file.

dotnet pack > res.txt
Vincent
  • 3,124
  • 3
  • 21
  • 40