Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core Azure管道中的Nuget Pack:未实现该方法或操作_Asp.net Core_Azure Devops_Nuget_Azure Pipelines - Fatal编程技术网

Asp.net core Azure管道中的Nuget Pack:未实现该方法或操作

Asp.net core Azure管道中的Nuget Pack:未实现该方法或操作,asp.net-core,azure-devops,nuget,azure-pipelines,Asp.net Core,Azure Devops,Nuget,Azure Pipelines,我正在尝试构建一个DotNetCore项目,并将包推送到Azure工件 我拥有的Azure-Pipelines.yml如下所示: trigger: - master pool: vmImage: 'Ubuntu-16.04' variables: buildConfiguration: 'Release' buildPlatform: 'any cpu' version: '1.0.0' steps: - task: DotNetCoreInstaller@0 dis

我正在尝试构建一个DotNetCore项目,并将包推送到Azure工件

我拥有的Azure-Pipelines.yml如下所示:

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' 
它在任务打包时失败,错误如下:

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 <48b97f13fd854060ad87a12d847b0428>: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 <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.ProjectFactory.BuildProject () [0x0016e] in <d0f788a4af354971807e5d8ca6fc682e>: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 <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildFromProjectFile (System.String path) [0x00140] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildPackage (System.String path) [0x00033] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildPackage () [0x00021] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PackCommand.ExecuteCommand () [0x001fe] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Command.ExecuteCommandAsync () [0x00000] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Command.Execute () [0x000b7] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in <d0f788a4af354971807e5d8ca6fc682e>: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 <48b97f13fd854060ad87a12d847b0428>:0 
  at NuGet.CommandLine.ProjectFactory.ResolveTargetPath () [0x00345] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.ProjectFactory.BuildProject () [0x0016e] in <d0f788a4af354971807e5d8ca6fc682e>: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 <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildFromProjectFile (System.String path) [0x00140] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildPackage (System.String path) [0x00033] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PackCommandRunner.BuildPackage () [0x00021] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PackCommand.ExecuteCommand () [0x001fe] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Command.ExecuteCommandAsync () [0x00000] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Command.Execute () [0x000b7] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in <d0f788a4af354971807e5d8ca6fc682e>:0)
##[error]An error ocurred while trying to pack the files.
##[section]Finishing: Pack
缓存工具:NuGet 4.1.0 x64
在缓存中找到工具:NuGet 4.1.0 x64
从工具缓存解析:4.1.0
使用版本:4.1.0
在缓存中找到工具:NuGet 4.1.0 x64
正在尝试打包文件:/home/vsts/work/1/s/MyProject.csproj
[命令]/usr/bin/mono/opt/hostedtoolcache/NuGet/4.1.0/x64/NuGet.exe pack/home/vsts/work/1/s/MyProject.csproj-非交互式-OutputDirectory/home/vsts/work/1/a-属性配置=发布-版本1.0.0-详细信息
System.NotImplementedException:方法或操作未实现。
NuGet版本:4.1.0.2450
at(包装器动态方法)System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Object)
正在尝试从“MyProject.csproj”生成包。
位于:0中的System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0](System.Runtime.CompilerServices.CallSite站点,T0 arg0)[0x00108]
MSBuild自动检测:使用“/usr/lib/mono/xbuild/14.0/bin”中的MSBuild版本“14.0”。使用选项-MSBuildVersion强制nuget使用特定版本的MSBuild。
在:0中的NuGet.CommandLine.ProjectFactory.ResolveTargetPath()[0x00345]处
位于:0中的NuGet.CommandLine.ProjectFactory.BuildProject()[0x0016e]
在NuGet.CommandLine.ProjectFactory.CreateBuilder(System.String basePath、NuGet.Versioning.NuGetVersion版本、System.String后缀、System.Boolean buildIfNeeded、NuGet.Packaging.PackageBuilder构建器)[0x00015]中:0
在:0中的numget.Commands.PackCommandRunner.BuildFromProjectFile(System.String路径)[0x00140]处
在:0中的numget.Commands.PackCommandRunner.BuildPackage(System.String路径)[0x00033]处
在:0中的numget.Commands.PackCommandRunner.BuildPackage()[0x00021]处
在0中的numget.CommandLine.PackCommand.ExecuteCommand()[0x001fe]处
在:0中的numget.CommandLine.Command.ExecuteCommandAsync()[0x00000]处
在:0中的NuGet.CommandLine.Command.Execute()[0x000b7]处
在NuGet.CommandLine.Program.MainCore(System.String workingDirectory,System.String[]args)[0x001f3]中:0
##[错误]nuget命令失败,退出代码(1)和错误(System.NotImplementedException:未实现该方法或操作。
at(包装器动态方法)System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Object)
位于:0中的System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0](System.Runtime.CompilerServices.CallSite站点,T0 arg0)[0x00108]
在:0中的NuGet.CommandLine.ProjectFactory.ResolveTargetPath()[0x00345]处
位于:0中的NuGet.CommandLine.ProjectFactory.BuildProject()[0x0016e]
在NuGet.CommandLine.ProjectFactory.CreateBuilder(System.String basePath、NuGet.Versioning.NuGetVersion版本、System.String后缀、System.Boolean buildIfNeeded、NuGet.Packaging.PackageBuilder构建器)[0x00015]中:0
在:0中的numget.Commands.PackCommandRunner.BuildFromProjectFile(System.String路径)[0x00140]处
在:0中的numget.Commands.PackCommandRunner.BuildPackage(System.String路径)[0x00033]处
在:0中的numget.Commands.PackCommandRunner.BuildPackage()[0x00021]处
在0中的numget.CommandLine.PackCommand.ExecuteCommand()[0x001fe]处
在:0中的numget.CommandLine.Command.ExecuteCommandAsync()[0x00000]处
在:0中的NuGet.CommandLine.Command.Execute()[0x000b7]处
在NuGet.CommandLine.Program.MainCore(System.String workingDirectory,System.String[]args)[0x001f3]中:0)
##[错误]尝试打包文件时出错。
##[部分]整理:包装
我尝试了许多配置,但无法删除错误


我遗漏了什么?

即使你做错了什么,NuGet也不应该给你一个NotImplementedException。请报告这一点,但鉴于这是一个.NET核心项目,您应该使用
dotnet-pack
,而不是我刚才报告的
mono-nuget.exe-pack
@zivkan,我也可以使用dotnet-pack解决它。谢谢。这是GitHub上登录的问题的链接:即使你做错了什么,NuGet也不应该给你一个NotImplementedException。请报告这一点,但鉴于这是一个.NET核心项目,您应该使用
dotnet-pack
,而不是我刚才报告的
mono-nuget.exe-pack
@zivkan,我也可以使用dotnet-pack解决它。谢谢。以下是登录到GitHub的问题的链接: