Can't Generate Project files in 5.4 (access denied to missing folder)

I can’t generate VS files on a 5.3 project that was upgraded to 5.4 or a fresh 5.4 Lyra sample project.

I get this error message:

Generating VisualStudio project files:
Discovering modules, targets and source code for project…
Total execution time: 0.78 seconds
Unhandled exception: System.UnauthorizedAccessException: Access to the path ‘C:\Program Files\Epic Games\UE_5.4\Engine\Intermediate\ProjectFiles’ is denied.
at System.IO.FileSystem.CreateDirectory(String fullPath, Byte securityDescriptor)
at System.IO.Directory.CreateDirectory(String path)
at EpicGames.Core.DirectoryReference.CreateDirectory(DirectoryReference location) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\Shared\EpicGames.Core\DirectoryReference.cs:line 272
at UnrealBuildTool.Utils.WriteFileIfChanged(FileItem FileItem, String Contents, StringComparison Comparison, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\Utils.cs:line 1765
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String Arguments, Boolean bCacheDataForEditor, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 954
at UnrealBuildTool.GenerateProjectFilesMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 65
at UnrealBuildTool.UnrealBuildTool.Main(String ArgumentsArray) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 660

I’ve tried installing every SDK for VS, verifying unreal, reinstalling unreal, setting the entire engine folder to writable, adding the missing folder it says is denied and I then get a new access denied error about another folder, turning off my firewall, installing dotnet core 3.1 x64 direct from Microsoft… I’m at a loss here.

The project opens fine with Lyra, but my project won’t because it has some broken code after the upgrade. And I can’t modify the Lyra game code since the VS files won’t generate.

The old VS file from 5.3 doesn’t work and won’t build once I upgrade.
Everything works just fine in 5.3

I’ll try every module in the “Compilers, build tools, and runtimes” section next.

However if anyone else knows what the issue is, advice would be greatly appreciated!

hi @Mewbits ,
Have you upgraded Visual Studio 2022 to the latest version . You cannot use VS 2019 in 5.4 release any more deprecated.
Try running VS2022 as Administrator Right Click Select “Run as Administrator” and try that again.

Thanks for the reply! I’m on the latest version of VS 2022. Is there a way to run generate VS project files from visual studio? Im just running it from the right click menu on the project file, so I dont know how it could be run as admin.

Try deleting the folders

  • .vs
  • Binaries
  • DerivedDataCache
  • Intermediate

Then try regenerating the visual studio project from the uproject file.

Thank you for the suggestion! That was one of the first things I tried. Sorry I forgot to mention it in the list of things I tried.

Could it be windows defender that is causing problems with the access? Try adding the folder to defenders list of exceptions (have it exclude it from real-time scans).

Windows Security > Virus & threat protection settings > Exclusions

1 Like

The error message suggests that the project is unable to generate VS files due to a lack of permissions to access the project files directory. The directory in question is “C:\Program Files\Epic Games\UE_5.4\Engine\Intermediate\ProjectFiles”.

To resolve this issue, you can try the following steps:

  1. Open an elevated command prompt (right-click on the command prompt and select “Run as administrator”).
  2. Navigate to the project directory using the “cd” command.
  3. Run the “icacls” command to check the permissions on the project directory.
  4. If the permissions are not set correctly, run the “icacls” command with the appropriate permissions. For example, you can run the following command to give read and write permissions to the current user:
icacls "C:\Program Files\Epic Games\UE_5.4\Engine\Intermediate\ProjectFiles" /grant:F <username>:F

Replace <username> with the username of the current user.

  1. After changing the permissions, try generating the VS files again.
1 Like

That was the solution! Although I used the properties panel to set permissions instead of the command prompt. Users couldn’t modify the 5.4 folders, but they could modify 5.3 folders. Thanks so much! VS files have been generated! :tada: :confetti_ball: :smile:

Thanks for the suggestion! Unfortunately it didn’t work, however turns out it was the folder permissions. Thanks so much for the help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.