In the answer to this question I needed to change the build yaml from using Nuget to using DotNet So that the .net standard project would pack correctly ( i hope ). However when I did this I started getting
error MSB4057: The target "pack" does not exist in the project
for the framework projects.
Should I be separating the repositories or is there some way to specify different pack commands for different targets?
My original azure-pipelines.yml was
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
Major: '2'
Minor: '0'
Patch: '0'
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=4.3.0'
checkLatest: true
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: NuGetCommand@2
inputs:
command: pack
packagesToPack: '**/*.csproj'
versioningScheme: byPrereleaseNumber
majorVersion: '$(Major)'
minorVersion: '$(Minor)'
patchVersion: '$(Patch)'
- task: NuGetCommand@2
inputs:
command: pack
packagesToPack: '**/*.vbproj'
versioningScheme: byPrereleaseNumber
majorVersion: '$(Major)'
minorVersion: '$(Minor)'
patchVersion: '$(Patch)'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
publishVstsFeed: 'SBDCommonFeed'
allowPackageConflicts: true
but I changed the NuGetCommand@2 task to be
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
outputDir: '$(Build.ArtifactStagingDirectory)/TestDir'
For the Nuget command I can experiment with PackagesToPack What do I change for the DotNet command?
[Update] I tried
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
projects: '**/*Standard.csproj'
outputDir: '$(Build.ArtifactStagingDirectory)/OutputDir'
Where *Standard are the .net standard projects. However there was still the MSB4057 error on a framework project