C# “如何解决TFS构建问题”;ResolveComReference“;任务意外失败进程可以';t访问文件系统.Windows.Interactivity.resources.dll';

C# “如何解决TFS构建问题”;ResolveComReference“;任务意外失败进程可以';t访问文件系统.Windows.Interactivity.resources.dll';,c#,.net,wpf,azure-devops,azure-pipelines,C#,.net,Wpf,Azure Devops,Azure Pipelines,我有一个WPF解决方案,我使用VisualStudioTeamServices和TFVC进行源代码控制。我已经创建了一个自动构建,但是,构建将失败(偶尔),并出现以下错误: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (2015, 0) The "ResolveComReference" task failed unexpectedly. System.IO.IOException: The p

我有一个WPF解决方案,我使用VisualStudioTeamServices和TFVC进行源代码控制。我已经创建了一个自动构建,但是,构建将失败(偶尔),并出现以下错误:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (2015, 0)
The "ResolveComReference" task failed unexpectedly.
System.IO.IOException: The process cannot access the file 'C:\a\bin\es\System.Windows.Interactivity.resources.dll' because it is being used by another process.
Server stack trace: 
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at Microsoft.Build.Tasks.Copy.CopyFileWithLogging(FileState sourceFileState, FileState destinationFileState)
at Microsoft.Build.Tasks.Copy.DoCopyWithRetries(FileState sourceFileState, FileState destinationFileState, CopyFileWithState copyFile)
at Microsoft.Build.Tasks.NativeMethods.QueryPathOfRegTypeLib(Guid& clsid, Int16 majorVersion, Int16 minorVersion, Int32 lcid)
at Microsoft.Build.Tasks.ComReference.GetPathOfTypeLib(TaskLoggingHelper log, Boolean silent, TYPELIBATTR& typeLibAttr, String& typeLibPath)
at Microsoft.Build.Tasks.ResolveComReference.ConvertAttrReferencesToComReferenceInfo(List`1 projectRefs, ITaskItem[] typeLibAttrs)
at Microsoft.Build.Tasks.ResolveComReference.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__1.MoveNext()
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(2015,0)
“ResolveComReference”任务意外失败。
System.IO.IOException:进程无法访问文件“C:\a\bin\es\System.Windows.Interactivity.resources.dll”,因为另一个进程正在使用该文件。
服务器堆栈跟踪:
在System.IO.\uuu Error.WinIOError(Int32 errorCode,字符串maybeFullPath)
位于System.IO.File.InternalCopy(字符串sourceFileName、字符串destFileName、布尔覆盖、布尔检查主机)
在Microsoft.Build.Tasks.Copy.CopyFileWithLogging(文件状态sourceFileState,文件状态DestinationListate)中
在Microsoft.Build.Tasks.Copy.DoCopyWithRetries(FileState sourceFileState、FileState destinationlestate、CopyFileWithState copyFile)
在Microsoft.Build.Tasks.NativeMethods.QueryPathOfRefreTypeLib(Guid&clsid、Int16主版本、Int16 minorVersion、Int32 lcid)
在Microsoft.Build.Tasks.ComReference.GetPathFTypeLib(TaskLoggingHelper日志、布尔静默、TYPELIBATTR和TYPELIBATTR、String和typeLibPath)
位于Microsoft.Build.Tasks.ResolveComReference.ConvertAttrReferencesToComReferenceInfo(列表`1 projectRefs,ITaskItem[]typeLibAttrs)
在Microsoft.Build.Tasks.ResolveComReference.Execute()中
在System.Runtime.Remoting.Messaging.StackBuilderSink.\u PrivateProcessMessage(IntPtr md,对象[]参数,对象服务器,对象[]和输出参数)
在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)中
在[0]处重试异常:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
at System.Runtime.Remoting.proxy.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)
在Microsoft.Build.Framework.ITask.Execute()中
位于Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ItaskeExecutionHost.Execute()
在Microsoft.Build.BackEnd.TaskBuilder.d_u1.MoveNext()中

当这种情况发生时。。我可以将另一个构建排队,它将通过。有人知道为什么会发生这种情况以及如何解决吗?

您有多个版本并行运行吗?或者您的解决方案中有多个使用同一引用的项目吗?我没有多个版本并行运行(我知道)。解决方案中有多个项目,但只有一个WPF项目直接引用System.Windows.Interactivity.resources.dll您使用的是哪个生成系统?Xaml或vNext?您有多个并行运行的构建吗?或者解决方案中有多个使用同一引用的项目吗?我没有多个并行运行的构建(据我所知)。解决方案中有多个项目,但只有一个WPF项目直接引用System.Windows.Interactivity.resources.dll您使用的是哪个生成系统?Xaml还是vNext?