I’m using different version of Visual Studio (run as admin 2013, 2015, 2017) and Unreal Engine (4.14, 4.15, 4.16) - result the same:
If project is allocated on disk D for example (not C), Visual Studio can’t build it.
1>------ Build started: Project: testcpp, Configuration: Development_Editor x64 ------
1>Creating makefile for hot reloading testcppEditor (no existing makefile)
1>EXEC : error : System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\UE_Projects\testcpp\testcpp.uproject'.
1> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1> 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)
1> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
1> at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
1> at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
1> at UnrealBuildTool.JsonObject.Read(String FileName)
1> at UnrealBuildTool.ProjectDescriptor.FromFile(String FileName)
1> at UnrealBuildTool.RulesCompiler.CreateProjectRulesAssembly(FileReference ProjectFileName)
1> at UnrealBuildTool.UEBuildTarget.CreateTarget(TargetDescriptor Desc, String[] Arguments, Boolean bCompilingSingleFile)
1> at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""D:\Program_D\Epic Games\UE_4.16\Engine\Build\BatchFiles\Build.bat" testcppEditor Win64 Development "D:\!WORK\!UE_Projects\testcpp\testcpp.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "testcpp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Somebody can help with it?)