When building, particularly for release versions, VS can add a lot of characters to paths with its output files and if you end up with a path over 260 characters you can get build errors caused by the path being too long (file inaccessible etc errors).

A solution is to enable long file path support in windows.

On Windows 10/11

Use regedit to alter the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled

(Type: REG_DWORD) must exist and be set to 1. You will likely need to reboot for the new setting to take effect.