Unreal 4.7 + Visual Studio P4VS issue

Unreal 4.7 + Visual Studio P4VS issue

There currently is an issue regarding using P4VS with Unreal 4.7 under Visual Studio 2013. Due to unreal 4.7 including Engine files, and they being part of the solution, P4VS will constantly try to check them, which they of course are not under version control. This causes Visual Studio to hang for about 2 to 5 minutes depending on machine speed. Unforunately trying to make use of the P4VS ignore in the Solution Explorer will not work. The only way to get around this issue currently is to turn of P4VS completely.

Example of the errors you will see in the P4VS log:


[Error: P4API.NET] 12/04/2015 02:13:19.8997 : Failed: Path 'c:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Slate\Public\Framework\Text\Android\AndroidPlatformTextField.h' is not under client's root 'C:\Users\Nakago\Perforce\Card_and_Dungeon'.

[Fatal: P4Command] 12/04/2015 02:13:19.9007 : Perforce.P4.P4Exception:Path 'c:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Slate\Public\Framework\Text\Android\AndroidPlatformTextField.h' is not under client's root 'C:\Users\Nakago\Perforce\Card_and_Dungeon'.

   at Perforce.P4.P4Exception.Throw(String cmd, String] args, P4ClientErrorList errors, P4ClientInfoMessageList details)
   at Perforce.P4.P4Server.RunCommand(String cmd, UInt32 cmdId, Boolean tagged, String] args, Int32 argc)
   at Perforce.P4.P4Command.RunInt(StringList flags)
[Error: P4API.NET] 12/04/2015 02:13:19.9017 : Perforce.P4.P4Exception:Path 'c:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Slate\Public\Framework\Text\Android\AndroidPlatformTextField.h' is not under client's root 'C:\Users\Nakago\Perforce\Card_and_Dungeon'.

   at Perforce.P4.P4Exception.Throw(String cmd, String] args, P4ClientErrorList errors, P4ClientInfoMessageList details)
   at Perforce.P4.P4Server.RunCommand(String cmd, UInt32 cmdId, Boolean tagged, String] args, Int32 argc)
   at Perforce.P4.P4Command.RunInt(StringList flags)
   at Perforce.P4.P4CommandResult..ctor(P4Command cmd, StringList flags)
   at Perforce.P4.P4Command.Run(StringList flags)
   at Perforce.P4.Repository.GetFileMetaData(Options options, FileSpec] filespecs)
   at Perforce.P4VS.P4ScmProvider.UpdateFileInCache(String file, Boolean forceUpdate)

I added the issue to an existing thread on the perforce forum about hanging visual studio:
http://forums.perforce.com/index.php?/topic/4012-solution-file-not-being-initialised-correctly-by-p4vs-on-load/

As well as over on Microsoft’s forum:
https://visualstudiogallery.msdn.microsoft.com/c42e78dd-846e-462c-bfce-6ee96b4eb7df/view/Discussions

If anyone over at Epic has any ideas, I am happy to try them out.

I have the same problem with P4VS and Unreal Engine 4.10. I was happy to install P4VS because when I edit a C++ code file in VS it automatically checks out the file from perforce (instead of requiring me to manually checkout the file from the P4V GUI and then edit it) (or worse if I am lazy I will edit the file without checking it out, then later have P4V consolidate it). It’s a good add-on except it makes Visual Studio completely lock up for multiple minutes as the Card and Dungeon describes.

This is more broadly an issue with Visual Studio. Visual Studio shouldn’t ever block the basic text editing functionality when it’s doing something in the background like updating intellisense or running some plugin such as P4VS. It’s also a problem with the P4VS plugin - it shouldn’t lockup Visual Studio’s text editing functionality to do automatic background perforce stuff. Finally yes I think it’s true that Unreal Engine exposes this problem with Visual Studio and Perforce, which is too bad because P4VS is a great match for UE4.

I didn’t look at the P4VS logs like Card and Dungeon, but I’m guessing I get the same error. I suppose I’ll just disable P4VS if it doesn’t stop doing it.

1 Like

Apparently lazy load fixes the problem:

From P4VS - Helix Plugin for Visual Studio - Visual Studio Marketplace :

> Tools -> Options -> Source Control -> Perforce General.
> You need to uncheck the previous 2 options (Treat file/folders and Preload file states) to enable the Lazy Load of file states option.
> Helix Core - Data Retrieval

Warning - I haven’t tried it myself yet because I’m away from my UE4 development computer

As of 2016/02/04, the option is actually under Tools -> Options -> Source Control -> Perforce - Data Retrieval -> Lazy load file state*