Build in pipeline DevOps cannot access file sometimes #3
-
Hi, We recently started using your NuGet and added it to our build pipeline. However, from time to time (not always), the file is locked and cannot be accessed. Have you stumbled upon this? You could implement something to wait until the file is unlocked, although the solutions I've found are ugly: Thread.Sleep(500), and retry 10x. https://stackoverflow.com/questions/50744/wait-until-file-is-unlocked-in-net My current solution is to rerun the build. It often works the second time.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I haven't seen that before, but the path in your error message looks odd since the .xml file mentioned is in the same folder as the .csproj rather than in the Is it possible your project sets the |
Beta Was this translation helpful? Give feedback.
-
Thank you. We did use DocumentationFile and didn't know about the GenerateDocumentationFile property. We have applied it to all our projects and will see if the issue still happens. |
Beta Was this translation helpful? Give feedback.
-
No problem! Let me know if that takes care of it, and I'll add a note to the readme. Could be a common issue since VS sets |
Beta Was this translation helpful? Give feedback.
-
Seems to be fixed. This issue seems to scale when using the regular DocumentationFile property in multiple projects inside the solution. We had converted all of the projects except for the two with the most xml comments, and didn't have the issue since. Now, after using GenerateDocumentationFile in these last two projects as well and many builds later, this issue hasn't occurred anymore. Seems to be fixed, thanks! |
Beta Was this translation helpful? Give feedback.
-
Great, thanks for following up! |
Beta Was this translation helpful? Give feedback.
I haven't seen that before, but the path in your error message looks odd since the .xml file mentioned is in the same folder as the .csproj rather than in the
obj
orbin
output folders.Is it possible your project sets the
DocumentationFile
property to just the XML file name? That would make it relative to the project and would cause problems when multi-targeting since multiple MSBuild instances run in parallel and would be accessing the same path. The preferred solution is to omit theDocumentationFile
property and simply set<GenerateDocumentationFile>true</GenerateDocumentationFile>
. In that configuration, MSBuild will set the path automatically and will create a separate file per targ…