简体   繁体   中英

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:

在此处输入图像描述

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.

For me, passing IncludeReferencedProjects=true worked.

- task: DotNetCoreCLI@2
  displayName: Pack Core.Shared
  inputs:
    command: 'pack'
    packagesToPack: '**/*.csproj'
    versioningScheme: 'byPrereleaseNumber'
    majorVersion: '1'
    minorVersion: '0'
    patchVersion: '0'
    buildProperties: 'IncludeReferencedProjects=true'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM