![](/img/trans.png)
[英]Publish-Module “Get-PackageSource Unable to find repository 'ArtifactoryDev'” error. Though ArtifactoryDev exists
[英]Publish-Module fails with NuGet.Build.Tasks.Pack.targets(198,5) error : Index was outside the bounds of the array
我已经升级到 dotnet sdk 3.1 版,并正在尝试发布我的 powershell 模块。 我正在使用 powershell 5.1。
我运行命令:
Publish-Module -Path "C:\sources\myModules\InstallationUtils\" -NuGetApiKey "xxxxxxx" -Repository internal.packages.org"
并得到错误:
[C:\Users\xxxxxx\AppData\Local\Temp\469d7c83-6e1a-4366-b948-6a415b0279be\Temp.csproj]
Successfully created package
'C:\Users\xxxxxx\AppData\Local\Temp\158464074\myModules\InstallationUtils\InstallationUtils.1.4.8.nupkg'.
C:\Program Files\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error :
Index was outside the bounds of the array.
[C:\Users\xxxxxx\AppData\Local\Temp\469d7c83-6e1a-4366-b948-6a415b0279be\Temp.csproj]
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.1\PSModule.psm1:10944 char:17
+ ... Publish-PSArtifactUtility @PublishPSArtifactUtility_Param ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility
有没有人有类似的问题并设法解决它? 谢谢
我有一个解决方法,其中涉及替换旧版本的版本 nuget.exe
C:\Users\xxxxx\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\
使用最新版本的 nuget.exe。
我在SQLDBAWithABeard上找到了解决方法,但我希望有比这更好的解决方案?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.