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

nuke-build nuke .tmp \ shell-completion.yml被另一个进程阻止

如何解决nuke-build nuke .tmp \ shell-completion.yml被另一个进程阻止

我有 4.7 .NET Framework 项目,并尝试使用 Nuke 0.24.11 进行构建。当我启动脚本

./build.ps1 --target npm --configuration Release --customerName 'Demo' --environmentName 'Prod'

(不依赖于目标内容)我收到该错误 该进程无法访问文件'C:.... tmp \ shell-completion.yml',因为该文件正在由另一个文件使用处理

只有当我使用以下属性时,它对我而言才可重现:

[TeamCity(
 TeamCityAgentPlatform.Windows,CleanCheckoutDirectory = false,VcsTriggeredTargets = new[] { nameof(Test),nameof(DeployBackend),nameof(DeployFrontend) },NightlyTriggeredTargets = new[] { nameof(Test),nameof(DeployFrontend) })]
[AzurePipelines(
 AzurePipelinesImage.UbuntuLatest,AzurePipelinesImage.WindowsLatest,AzurePipelinesImage.MacOsLatest,InvokedTargets = new[] { nameof(Test),nameof(DeployFrontend) })]
internal class Build : NukeBuild {
  ...
}

Nuke日志:

该进程无法访问文件'.... tmp \ shell-completion.yml' 因为它正在被另一个进程使用。在 System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
在System.IO.FileStream.CreateFileOpenHandle(FileMode模式,FileShare 共享,位于System.IO.FileStream..ctor(String)上的FileOptions选项) 路径,FileMode模式,FileAccess访问,FileShare共享,Int32 bufferSize,FileOptions选项)位于 System.IO.StreamWriter.ValidateArgsAndOpenPath(字符串路径,布尔 附加,编码编码,Int32 bufferSize)位于 System.IO.StreamWriter..ctor(字符串路径)位于 System.IO.File.WriteallText(字符串路径,字符串内容)位于 Nuke.Common.Execution.HandleShellCompletionAttribute.OnBeforelogo(NukeBuild 构建,IReadOnlyCollection 1 executableTargets) at Nuke.Common.Execution.BuildManager.<>c__displayClass5_0 1.b__3(IOnBeforelogo x)在 Nuke.Common.Utilities.Collections.EnumerableExtensions.ForEach [T](IEnumerable 1 enumerable,Action 1操作)在 Nuke.Common.Execution.BuildManager。 c__displayClass5_0 1.<Execute>g__ExecuteExtension|1[TExtension](Action 1操作) Nuke.Common.Execution.BuildManager.Execute [T](Expression`1 [] defaultTargetExpressions)

AzurePipelines配置文件已更改。 #1/1:进程“ dotnet.exe”以代码-1退出

“ C:\ Program Files \ dotnet \ dotnet.exe” ... \ build \ bin \ Debug_build.dll-生成配置TeamCity --host TeamCity @ E:...

在 Nuke.Common.Tooling.ProcessExtensions.AssertZeroExitCode(IProcess 处理) Nuke.Common.CI.HandleConfigurationGenerationAttribute.InvokeGeneration(IConfigurationGenerator 发电机) System.Linq.Parallel.ForAllOperator 1.ForAllEnumerator 1.MoveNext(TInput& currentElement,Int32&currentKey) System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()在 System.Linq.Parallel.SpoolingTaskBase.Work()在 System.Linq.Parallel.QueryTask.BaseWork(对象未使用)位于 System.Linq.Parallel.QueryTask。 c。 b__10_0(对象o)在 System.Threading.Tasks.Task.InnerInvoke()在 System.Threading.Tasks.Task。 c。 b__274_0(Object obj)在 System.Threading.ExecutionContext.RunFromThreadPooldispatchLoop(线程 threadPoolThread,ExecutionContext executeContext,ContextCallback 回调,对象状态) ---从之前引发异常的位置开始的堆栈跟踪- System.Threading.ExecutionContext.RunFromThreadPooldispatchLoop(线程 threadPoolThread,ExecutionContext executeContext,ContextCallback 回调,对象状态) System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot,线程threadPoolThread)

重复警告和错误:AzurePipelines配置文件具有 改变了。 #1/1:进程“ dotnet.exe”以代码-1退出

“ C:\ Program Files \ dotnet \ dotnet.exe” ... \ build \ bin \ Debug_build.dll-生成配置TeamCity --host TeamCity @ E:...

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