微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Azure DevOps - Octopus 的包应用程序:System.IO.IOException:参数不正确 *

如何解决Azure DevOps - Octopus 的包应用程序:System.IO.IOException:参数不正确 *

我正在尝试将我的应用程序打包成一个 zip 文件,以便将其发送给 Octopus。

日志如下所示:

2021-05-17T21:15:00.8077153Z D:\a\r1\a>dotnet "C:\hostedtoolcache\windows\octo\7.4.3213\x64\/octo.dll" pack "--id=KFPortal" "--format=Zip" "--version=1.0.19" "--compressionlevel=optimal" "--outFolder=D:\a\r1\a" "--basePath=D:\a\r1\a\_KFPortal-CI\drop\19.zip" "--overwrite=false" 
2021-05-17T21:15:05.3741444Z Setting Zip compression level to Optimal
2021-05-17T21:15:05.3940706Z Packing KFPortal version "1.0.19"...
2021-05-17T21:15:05.4077016Z Saving "KFPortal.1.0.19.zip" to "D:\a\r1\a"...
2021-05-17T21:15:05.4095140Z Adding files from "D:\a\r1\a\_KFPortal-CI\drop\19.zip" matching pattern "**"
2021-05-17T21:15:06.7197552Z 
2021-05-17T21:15:06.7200093Z System.IO.IOException: The parameter is incorrect : 'D:\a\r1\a\_KFPortal-CI\drop\19.zip'
2021-05-17T21:15:06.7200973Z    at System.IO.Enumeration.FileSystemEnumerator`1.GetData()
2021-05-17T21:15:06.7201594Z    at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry()
2021-05-17T21:15:06.7202125Z    at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
2021-05-17T21:15:06.7202656Z    at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
2021-05-17T21:15:06.7203234Z    at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
2021-05-17T21:15:06.7203850Z    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
2021-05-17T21:15:06.7204507Z    at NuGet.Common.PathResolver.PerformWildcardSearch(String basePath,String searchPath,Boolean includeEmptyDirectories,String& normalizedBasePath)
2021-05-17T21:15:06.7205322Z    at NuGet.Common.PathResolver.PerformWildcardSearch(String basePath,String searchPath)
2021-05-17T21:15:06.7206400Z    at Octopus.Cli.Commands.Package.ZipPackageBuilder.BuildPackage(String basePath,IList`1 includes,ManifestMetadata Metadata,String outFolder,Boolean overwrite,Boolean verboseInfo) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\ZipPackageBuilder.cs:line 62
2021-05-17T21:15:06.7208001Z    at Octopus.Cli.Commands.Package.PackCommand.<>c__displayClass21_0.<Execute>b__0() in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\PackCommand.cs:line 167
2021-05-17T21:15:06.7208829Z    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state)
2021-05-17T21:15:06.7209379Z --- End of stack trace from prevIoUs location where exception was thrown ---
2021-05-17T21:15:06.7209871Z    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
2021-05-17T21:15:06.7210349Z --- End of stack trace from prevIoUs location where exception was thrown ---
2021-05-17T21:15:06.7210984Z    at Octopus.Cli.CliProgram.Run(String[] args) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\CliProgram.cs:line 54
2021-05-17T21:15:06.7211497Z Exit code: -3
2021-05-17T21:15:06.7420731Z ##[error]Error: The process 'C:\hostedtoolcache\windows\octo\7.4.3213\x64\octo.cmd' Failed with exit code 4294967293
2021-05-17T21:15:06.7437803Z ##[error]Failed to execute octo pack command. The process 'C:\hostedtoolcache\windows\octo\7.4.3213\x64\octo.cmd' Failed with exit code 4294967293
2021-05-17T21:15:06.7489404Z ##[section]Finishing: Package KFPortal

这是我的配置

enter image description here

我做错了什么?

解决方法

我认为真正的问题是您没有为托管代理下的项目设置正确的源路径

如果您的 repos 分支有名为 _KFPortal-CI 的文件夹,那么您应该将 Sources Path 设置为

$(System.DefaultWorkingDirectory)/_KFPortal-CI

这就足够了,drop 文件夹来自工件任务,仅临时存在于工件任务中,它永远不会存在于 repos 下。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?