MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
193 stars 65 forks source link

Tool Erroring out on temp file - System.IO.IOException: The process cannot access the file '...Local\Temp\tmp1F05.html' because it is being used by another process. #158

Open annabelspain opened 1 week ago

annabelspain commented 1 week ago

When running the tool to export my wiki to PDF, both locally and when using DevOps pipeline I am getting the same error on each run relating to the process not be able to access a temp file.

Local Method: The wiki has been cloned, saved locally, with version 4.6.0 WikiPDFExport downloaded and used within the folder structure. The steps mentioned within the "quick start" guide were followed (https://github.com/MaxMelcher/AzureDevOps.WikiPDFExport?tab=readme-ov-file#-quickstart). After running the tool, the error appears briefly within the console before exiting the run and closing the command prompt. Please see below the error seen using the local method:

image

DevOps Method: The wiki is saved as "wiki as code" repository in DevOps. A yaml pipeline has been created which uses the Wiki PDF Export Tasks (https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VSTS-WikiPDFExport-Tasks&ssr=false#overview), that wraps the WikiPDFExport tool. The pipeline contains three tasks, one to install dotnet 6 onto the build agent, then to run the task as follows below, and the final task publishes the private wiki export as a pipeline artifact. : - task: richardfennellBM.BM-VSTS-WikiPDFExport-Tasks.WikiPDFExportTask.WikiPdfExportTask@3 displayName: 'Export a private Azure DevOps WIKI'

System.IO.IOException: The process cannot access the file 'C:\Users\VssAdministrator\AppData\Local\Temp\tmp1F05.html' because it is being used by another process. at System.IO.FileSystem.DeleteFile(String fullPath) at System.IO.FileInfo.Delete() at azuredevops_export_wiki.SelfDeletingTemporaryFile.Dispose(Boolean disposing) at azuredevops_export_wiki.SelfDeletingTemporaryFile.Dispose() at azuredevops_export_wiki.WikiPDFExporter.Export()

[error]Error: Command failed: "D:\a_temp\azuredevops-export-wiki.exe" -p "D:\a\1\s/repo/Documentation" -o "D:\a\1\a/PDF/Wiki-As-Code.pdf" -v

[error]Error: Command failed: "D:\a_temp\azuredevops-export-wiki.exe" -p "D:\a\1\s/repo/Documentation" -o "D:\a\1\a/PDF/Wiki-As-Code.pdf" -v

Finishing: Export a private Azure DevOps WIKI

image

Other points to note:

Any suggestions to get around this error would be really appreciated, thank you for your time!