# Why cant I generate visual studio project files

**URL:** <https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992>\
**Category:** Platform & Builds\
**Tags:** error, build, unreal-engine, generate-project-fil, CPP, question\
**Created:** [October 4, 2018, 3:28am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992 "2018-10-04T03:28:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfw7755](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rfw7755](https://forums.unrealengine.com/u/rfw7755)\
**Post date:** [October 4, 2018, 3:28am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/1 "2018-10-04T03:28:45Z")

</div>

Hi Everyone,

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](http://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)

---

<div class="post-metadata">

**Author:** ![NicholasMont](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NicholasMont](https://forums.unrealengine.com/u/NicholasMont)\
**Post date:** [October 5, 2018, 3:39pm UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/2 "2018-10-05T15:39:11Z")

</div>

Hello rfw7755,

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.

Does this result in any success?

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [October 6, 2018, 5:26am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/3 "2018-10-06T05:26:38Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 8, 2018, 9:07pm UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/4 "2018-10-08T21:07:53Z")

</div>

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.

I just opened a question here, too: [Can't Generate Project Files - Unauthorized access to other PC's accounts - C++ - Unreal Engine Forums](https://answers.unrealengine.com/questions/835644/cant-generate-project-files-unauthorized-access-to.html)

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.

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 9, 2018, 7:21am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/5 "2018-10-09T07:21:38Z")

</div>

Bump. This is an important bug and deserves attention.

---

<div class="post-metadata">

**Author:** ![NicholasMont](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NicholasMont](https://forums.unrealengine.com/u/NicholasMont)\
**Post date:** [October 9, 2018, 12:48pm UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/6 "2018-10-09T12:48:53Z")

</div>

Hello rfw7755 ,

if you open a terminal directly from your UBT folder and try the following:

> ./UnrealBuildTool.exe -projectfiles  
> -project=“C:/home/test/Documents/Repro 18/Repro18.uproject”

Does this work? If this is not successful, open a terminal from desktop and try:

> “C:/Users/Ron\ White/Documents/Unreal  
> Projects/projects/codetests/codetest/codetest.uproject”

Please let me know what results you receive.

Thank you!

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 9, 2018, 2:22pm UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/7 "2018-10-09T14:22:40Z")

</div>

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.

So I can use this as a workaround for now.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/1/ac1b414ec5af71407af0a65478ca1bfe197f29c4.png)

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 6:04am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/8 "2018-10-15T06:04:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 7:30am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/9 "2018-10-15T07:30:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 15, 2018, 7:33am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/10 "2018-10-15T07:33:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 7:35am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/11 "2018-10-15T07:35:55Z")

</div>

Hm, can you post your batch file here so that I can try that?

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 15, 2018, 7:38am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/12 "2018-10-15T07:38:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 7:49am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/13 "2018-10-15T07:49:17Z")

</div>

Thanks! But actually, that’s not doing anything for me, I just see “Press any key…” immediately after opening it.

Could you maybe format your post so that the .bat is in code format? Maybe the formatting here breaks it. I mean this code format stuff:

```
Test123
```

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 15, 2018, 7:50am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/14 "2018-10-15T07:50:11Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 8:03am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/15 "2018-10-15T08:03:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 15, 2018, 8:05am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/16 "2018-10-15T08:05:15Z")

</div>

4.20. Did you change the UE\_4.20 in the path as well? That may be the reason if you are trying to use the 4.20 UBT to build the 4.19 project c++ data.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 15, 2018, 8:06am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/17 "2018-10-15T08:06:03Z")

</div>

I’m not using a launcher build, so I have copied in my custom path where the engine is installed, yeah.

---

<div class="post-metadata">

**Author:** ![Herr\_Edgy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herr_edgy/32/924115_2.png) [@Herr\_Edgy](https://forums.unrealengine.com/u/Herr_Edgy)\
**Post date:** [October 15, 2018, 8:07am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/18 "2018-10-15T08:07:24Z")

</div>

I see. Tough luck. I think you should create a new question here and expand upon it, for better visibility.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [October 17, 2018, 3:04am UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/19 "2018-10-17T03:04:11Z")

</div>

@NicholasMont could you comment on this? I would really like to be able to generate project files again…

---

<div class="post-metadata">

**Author:** ![NicholasMont](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NicholasMont](https://forums.unrealengine.com/u/NicholasMont)\
**Post date:** [October 17, 2018, 2:52pm UTC](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992/20 "2018-10-17T14:52:27Z")

</div>

Hello John,

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.

Thanks!

Sincerely,  
Nicholas

[Next page](https://forums.unrealengine.com/t/why-cant-i-generate-visual-studio-project-files/434992.md?page=2)
