Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nuget command to IncludeReferencedProjects in azure devops

In Azure devops I want to issue a nuget pack command that passes the option IncludeReferencedProjects. My repo is in TFVC so I do not believe I can use azure-pipelines.yml. I believe I must do this through the visual designer. I don't see an option to pass additional arguments to the nuget with the pack command type. This makes me think I have to use the custom command type for nuget. When I'm using the custom command type, I can specify -IncludeReferencedProjects but I do not seem to be able to specify **\*.csproj as the items to pack. If I do this the command fails with:

[command]C:\hostedtoolcache\windows\NuGet\4.1.0\x64\nuget.exe pack **\*.csproj -IncludeReferencedProjects -Symbols -Verbosity Detailed -NonInteractive
System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

How can I pack all csproj output with the IncludeReferencedProjects flag using the visual designer? Here's a picture of what I have in designer:

enter image description here

like image 283
user2719430 Avatar asked Nov 07 '22 19:11

user2719430


1 Answers

How can I pack all csproj output with the IncludeReferencedProjects flag using the visual designer?

I am afraid you could not pack all csproj output with the IncludeReferencedProjects flag.

That because pack command (NuGet CLI) does not support wildcard.

When you use nuget pack command line with wildcard, you will always get the error Unknown command: '**\*.csproj'. (This error also exists locally.)

To resolve this issue, we could add multiple nuget pack tasks to pack those projects.

Hope this helps.

like image 186
Leo Liu-MSFT Avatar answered Nov 26 '22 21:11

Leo Liu-MSFT