
2016-07-01T06:40:25.3532321Z ##[error]Error: System.IO.IOException: The process cannot access the file 'D:\Builds\Agenta4a39e\...\bin\DeBUG\mscorlib.4.0.0.0.Fakes.FakedTypesCache' because it is being used by another process.2016-07-01T06:40:25.3532321Z ##[error] at System.IO.__Error.WinIOError(Int32 errorCode,String maybeFullPath)2016-07-01T06:40:25.3532321Z ##[error] at System.IO.fileStream.Init(String path,fileMode mode,fileAccess access,Int32 rights,Boolean useRights,fileShare share,Int32 bufferSize,fileOptions options,Security_ATTRIBUTES secAttrs,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)2016-07-01T06:40:25.3532321Z ##[error] at System.IO.fileStream..ctor(String path,Boolean checkHost)2016-07-01T06:40:25.3532321Z ##[error] at System.IO.StreamReader..ctor(String path,EnCoding enCoding,Boolean detectEnCodingFromByteOrderMarks,Boolean checkHost)2016-07-01T06:40:25.3532321Z ##[error] at System.IO.StreamReader..ctor(String path)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.FakesAssemblyReflector.LoadShimTypesFromCache(String fakedTypesCachefilePath)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.FakesAssemblyReflector.ReflectShimTypes(String fakesAssemblyFullPath)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.UnitTestIsolationDataCollector.PopulateCollectionPlan(_CollectionPlan plan,XmlElement settings)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.UnitTestIsolationDataCollector.OnSecondCollectorToInitialize(_CollectionPlan plan,XmlElement configurationElement)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.CommonDataCollector.OnInitialize(XmlElement configurationElement)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.BaseDataCollector.InternalConstruct(XmlElement configurationElement,IDataCollectionEvents events,IDataCollectionSink dataSink,IDataCollectionLogger logger,IDataCollectionAgentContext agentContext)2016-07-01T06:40:25.3532321Z ##[error] at Microsoft.VisualStudio.TraceCollector.BaseDataCollector.Initialize(XmlElement configurationElement,DataCollectionEvents events,DataCollectionSink dataSink,DataCollectionLogger logger,DataCollectionEnvironmentContext environmentContext)2016-07-01T06:40:25.3532321Z ##[error] at WEX.TestExecution.DataCollectorTestMode.Initialize(ITestModeSettings settings,ICallbackRegistrar callbackRegistrar)2016-07-01T06:40:25.3532321Z ##[error]
我不确定它是否必须对我们的代码覆盖做一些事情(因为堆栈跟踪提到了这个数据采集器).我们使用runsettings文件从代码覆盖中输入/排除某些内容.
在构建服务器上,我们安装了Visual Studio 2015 Update 3(但问题出现在Update 2中),TFS是2015版RTM.
显然锁定的文件并不总是相同,但它始终是“FakeTypeCaches”之一.
任何帮助,将不胜感激
谢谢
编辑
似乎问题是由并行运行单元测试引起的(我认为该选项自VS 2015 Update 1起可用).并行运行它们似乎已经解决了问题,但遗憾的是,运行我们的测试现在需要相当长的时间来运行.特别是对于我们的CI构建,这并不理想,因为我们希望尽快得到反馈.@H_404_7@如果我们只能按顺序运行使用Faked / Stubbed类的测试,那么我知道我不知道如何实现这一点.
我们现在解决这个问题的方法是用Testcategory标记所有使用Fakes / Shims的测试:[Testcategory(“Sequential”)]
在构建服务器上,我们定义了两个单元测试步骤,除了“Sequential”之外的所有类别的第一个过滤器并行运行,第二个然后不并行运行“Sequential”.
解决方法 根据错误消息,似乎其他进程持有该文件. @H_404_7@尝试使用 this tool来确定哪个文件正好被哪个进程锁定.然后在建筑物正在进行时停止该过程. 总结以上是内存溢出为你收集整理的c# – TFS Build失败,“无法访问文件* FakeTypesCache”全部内容,希望文章能够帮你解决c# – TFS Build失败,“无法访问文件* FakeTypesCache”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)