title: Nuget Pack in Azure Pipelines: The method or operation is not implemented
body: <p>I am trying to build a DotNetCore project and push the package to Azure Artifacts.</p>
  
  <p>The Azure-Pipelines.yml I have is the following:</p>
  
  <pre><code>trigger:
  - master
  
  pool:
    vmImage: 'Ubuntu-16.04'
  
  variables:
    buildConfiguration: 'Release'
    buildPlatform: 'any cpu'
    version: '1.0.0'
  
  steps:
  
  - task: DotNetCoreInstaller@0
    displayName: 'Install'
    inputs:
      packageType: 'sdk'
      version: '2.2.105'
  
  - task: DotNetCoreCLI@2
    displayName: 'Restore'
    inputs:
      command: restore
      projects: '**/*.csproj'
  
  - task: DotNetCoreCLI@2
    displayName: 'Build'
    inputs:
      command: build
      projects: '**/*.csproj'
      arguments: '--configuration $(buildConfiguration)'
  
  - task: NuGetCommand@2
    displayName: 'Pack'
    inputs:
      command: pack
      versioningScheme: byEnvVar
      versionEnvVar: version
  
  - task: NuGetCommand@2
    displayName: 'Push'
    inputs:
      command: push
      publishVstsFeed: 'myfeed' 
  </code></pre>
  
  <p>It fails on task <strong>Pack</strong> with the error:</p>
  
  <pre><code>Caching tool: NuGet 4.1.0 x64
  Found tool in cache: NuGet 4.1.0 x64
  Resolved from tool cache: 4.1.0
  Using version: 4.1.0
  Found tool in cache: NuGet 4.1.0 x64
  Attempting to pack file: /home/vsts/work/1/s/MyProject.csproj
  [command]/usr/bin/mono /opt/hostedtoolcache/NuGet/4.1.0/x64/nuget.exe pack /home/vsts/work/1/s/MyProject.csproj -NonInteractive -OutputDirectory /home/vsts/work/1/a -Properties Configuration=Release -version 1.0.0 -Verbosity Detailed
  System.NotImplementedException: The method or operation is not implemented.
  NuGet Version: 4.1.0.2450
    at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object)
  Attempting to build package from 'MyProject.csproj'.
    at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x00108] in &lt;48b97f13fd854060ad87a12d847b0428&gt;:0 
  MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
    at NuGet.CommandLine.ProjectFactory.ResolveTargetPath () [0x00345] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.ProjectFactory.BuildProject () [0x0016e] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.ProjectFactory.CreateBuilder (System.String basePath, NuGet.Versioning.NuGetVersion version, System.String suffix, System.Boolean buildIfNeeded, NuGet.Packaging.PackageBuilder builder) [0x00015] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildFromProjectFile (System.String path) [0x00140] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildPackage (System.String path) [0x00033] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildPackage () [0x00021] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.PackCommand.ExecuteCommand () [0x001fe] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Command.ExecuteCommandAsync () [0x00000] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Command.Execute () [0x000b7] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
  ##[error]The nuget command failed with exit code(1) and error(System.NotImplementedException: The method or operation is not implemented.
    at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object)
    at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x00108] in &lt;48b97f13fd854060ad87a12d847b0428&gt;:0 
    at NuGet.CommandLine.ProjectFactory.ResolveTargetPath () [0x00345] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.ProjectFactory.BuildProject () [0x0016e] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.ProjectFactory.CreateBuilder (System.String basePath, NuGet.Versioning.NuGetVersion version, System.String suffix, System.Boolean buildIfNeeded, NuGet.Packaging.PackageBuilder builder) [0x00015] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildFromProjectFile (System.String path) [0x00140] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildPackage (System.String path) [0x00033] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.Commands.PackCommandRunner.BuildPackage () [0x00021] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.PackCommand.ExecuteCommand () [0x001fe] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Command.ExecuteCommandAsync () [0x00000] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Command.Execute () [0x000b7] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0 
    at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in &lt;d0f788a4af354971807e5d8ca6fc682e&gt;:0)
  ##[error]An error ocurred while trying to pack the files.
  ##[section]Finishing: Pack
  </code></pre>
  
  <p>I tried many configurations but I am not able to remove the error.</p>
  
  <p>What am I missing?</p>