I have the issue where when I try to rebuild my visual studio project files I get the error listed below. I’m at a loss and cant get around this error. Any help or input would be appreciated.
Thanks!
Running C:/Program Files/Epic Games/UE_4.18/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Users/Ron White/Documents/Unreal Projects/projects/codetests/codetest/codetest.uproject” -game -rocket -progress -log=C:\Users\Ron White\Documents\Unreal Projects\projects\codetests\codetest/Saved/Logs/UnrealVersionSelector-2018.10.03-23.20.38.log
ERROR: UnrealBuildTool Exception: System.UnauthorizedAccessException: Access to the path ‘c:\users\ron’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
at UnrealBuildTool.UnrealBuildTool.GuardedMain(String[] Arguments)
Does the user “Ron White” have administrative privileges?
If you navigate to your C:/Program Files/Epic Games/ folder and right click-> Select Properties-> Select Security-> Edit the permissions to allow access to all users.
@NicholasMont this is not a privilege problem but a string construction issue involving white space. something was changed in UBT that creates the same error you can face sometimes in Linux when path with white space are not handle properly.
I have a very similar or even the same problem. When I tried with UE 4.20, the message is different, but results in the same, more or less.
When I tried generating project files with 4.19, I got the exact same message though, down to UnrealVersionSelecter.log file and the UnauthorizedAccessException to the cut part of the user name.
But it seems my guess was wrong. I had, coincidentally, a 2nd user with the very same name (in this case: ron), so I thought the system tried accessing the 2nd user. But if that’s not the case for you then that really just leaves the white space issue.
Can Staff clarify? This is a really big issue with no easy fix on the OS side. I think the UBT needs to be fixed ASAP.
I can’t speak for rfw7755, but as I have the same problem my answer might help you. I did not try the first one as I do not understand it. I did, however, test the 2nd one, which results in an error message because the program will then try to look up FirstName\ LastName which obviously does not exist.
So, escaping the whitespace does not work.
However, that was not necessary in the first place. using the UBT via command line works just fine when given the proper path of C:/Users/FirstName LastName/…/Project.uproject". It seems only the rightclick function does not work. I do, however, get the following warning which seems unrelated. I thought it was worth mentioning though.
I did have the same issue today. I have successfully generated project files probably >100 of times for this project in the past few years, and today is suddenly didn’t work any more. I do use whitespaces in the path, and that seems to be the issue.
Doing it with the first method you mentioned worked, thanks for that! Still significantly more inconvenient than right clicking the uproject file.
Actually, it did NOT work. It says “writing project files… 100%” and everything looks good, but it never created a new .sln file, the file was not modified. Now I deleted my old .sln file and it does NOT create a new one. So unfortunately this does not seem to workaround the issue. @NicholasMont@Quexlaw
Thanks! The .bat file works now, but the issue is same now like previously, it says everything would finish successfull but I don’t actually get any .sln file generated. Very weird that it works for you but not for me! Which UE4 Version are you using? I’m on 4.19.
That’s weird. It definitely does work for me. Even wrote a batch script so I could use it for all of my projects, just in case, and I tested by creating a new project, as well as deleting my old .sln.
Sure, but it’s kind of a cheat, so you will have to edit some of the lines.
REM Project must be in FirstName LastName\Documents\Unreal Projects to work
@echo off
set /p projectName="Enter Project to generate files: "
“C:\Program Files\Epic Games\UE_4.20\Engine\Binaries\DotNET/UnrealBuildTool.exe” -projectfiles -project=“C:\Users\FirstName LastName\Documents\Unreal Projects%projectName%%projectName%.uproject”
@pause
The parts you have to edit should be obvious.
EDIT:
When executing the batch file, you just have to type in the name of your project, such as “BestProject”. Do not specify a path, just the name of the project. This batch file will look it up for you if you specified the path in the batch file correctly.
The Terminal commands provided are for a linux environment, are you using Windows Or Linux?
If you’re using windows, I’d like to ask you to please create a separate question with more details specific to the issues you’re experiencing.