cake: Exception running InspectCode and then directly after TeamCity.ImportData
Here is the exception
[17:00:11][Step 1/1] Importing data from ‘artifacts/_ReSharperReports/inspectcode-report.xml’ (45.71 KB) with ‘ReSharperInspectCode’ processor [17:00:11][Step 1/1] Caught exception while running service process importData [17:00:11] [Step 1/1] java.io.FileNotFoundException: C:\Temp\buildAgent1\work\ab9b99833ae569b1\artifacts_ReSharperReports\inspectcode-report.xml (The process cannot access the file because it is being used by another process) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at jetbrains.buildServer.dotnetTools.agent.inspectCode.InspectCodeFileProcessor.processReport(InspectCodeFileProcessor.java:54) at jetbrains.buildServer.dotnetTools.agent.inspectCode.InspectCodeDataProcessor.processData(InspectCodeDataProcessor.java:38) at jetbrains.buildServer.agent.impl.inspections.DataImportServiceMessage$1.run(DataImportServiceMessage.java:93) at jetbrains.buildServer.agent.impl.serviceProcess.impl.ThreadedServiceProcessFactory$1.run(ThreadedServiceProcessFactory.java:31) at java.lang.Thread.run(Thread.java:745)
This is due to this line which does resultsFile.Open(FileMode.Open)
Looks like there is the same problem here https://github.com/cake-build/cake/blob/develop/src/Cake.Common/Tools/DupFinder/DupFinderRunner.cs#L193 cc @gep13
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- (GH-805) Correcting issue with locked file - Rather than opening the File, thus locking it, use a Stream to dispose of the lock on the file when working with it has completed. — committed to gep13/cake by gep13 8 years ago
- Merge pull request #807 from gep13/Issue/GH-805 (GH-805) Correcting issue with locked file — committed to cake-build/cake by devlead 8 years ago
- (GH-805) Correcting issue with locked file - Rather than opening the File, thus locking it, use a Stream to dispose of the lock on the file when working with it has completed. — committed to cake-build/cake by gep13 8 years ago
👍 Works perfectly! well done @gep13