Edit

Share via


MSB3374 diagnostic code

This article describes the MSB3374 error code.

Message text

MSB3374: The last access/last write time on file 'value' cannot be set. 'value'

Description

The error occurs when MSBuild tries to update the timestamp on a file, but it couldn't be updated. This could occur when the file exists, but its permissions are set to not allow write access, or it could occur when some other program, such as Antivirus software, has a lock on the file. The error from the operating system is shown after the MSBuild message text. In the case of a file lock, the message might contain the process or application that has the lock.

Resolution

If the error indicates a permissions issue, update the file permissions to allow write access to the account that runs MSBuild.

If the error indicates a file was locked, if the message indicates the service, process or application that has the lock, try to disable the service, kill the process, or shut down the application. You can also try building again or building again after a system reboot.

If the file is generated by the build, review the part of the build process that generates that file and see if its permissions are being set incorrectly.

To help debug the issue use the diagnostic logs (-v:diag command-line option) or generate a binary log (-bl command-line option) and view it in the MSBuild structured log viewer.

Applies to

All versions of MSBuild