c# – Error CVT1108 cannot open RES….tmp for writing intermittently appearing on DevOps pipeline


I have a pipeline building my C# application using Visual Studio 2019. Occasionally when building the solution, I get the following error.

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\al.exe /culture:da /out:obj\Release\da\MyApp.resources.dll /platform:AnyCPU /template:obj\Release\MyApp.exe /embed:obj\Release\MyApp.Properties.Resources.da.resources

##[error]CVTRES(0,0): Error CVT1108: cannot open C:\Users\WP2BUI~1\AppData\Local\Temp\RES161C.tmp for writing

The filename is always different (but it’s always RESxxxx.tmp) and if I look on the server in the specified directory, there are a large number of these RES….tmp files, however the ones reported by this error message all appear to have a size of 0 bytes.

An internet search for the error message turns up multiple hits but in each case, it amounts to ensuring the build agent has write privileges to that directory. I don’t feel like this is the answer in this case, as I’ve checked and the user does seem to have write privileges, and I would imagine if this was the problem it would fail every time.

Two other things I should point out.

  1. There are many developers using this pipeline – it’s a Continuous Integration pipeline used for pull requests.

  2. When I build the application on my own machine and monitor the same dir, the RES….tmp file appears briefly and disappears, which makes me think VS should be deleting it after use. However, on the build server, there are hundreds of these files left over from a few months’ worth of builds.

Edit

This error appears below the above. Not sure if it’s caused by the above error or is the cause of it – but in case it matters:

CVTRES : fatal error CVT1108: cannot open C:\Users\WP2BUI~1\AppData\Local\Temp\RES161C.tmp for writing [c:\agent_work\56\s\src\MyApp\MyApp.csproj]

##[error]ALINK(0,0): Error AL1019: Metadata failure while creating assembly — The specified image file did not contain a resource section.

Leave a Reply

Your email address will not be published. Required fields are marked *