Jump to content


Solution file not being initialised correctly by P4VS on load

P4VS

  • Please log in to reply
12 replies to this topic

#1 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 07 April 2015 - 01:18 PM

This is a problem I've had both with 2014.3 and now P4VS 2015.1.103.4687. When I do not have "Preload file state selected", the solution file does not seem to initialise properly - it has a question mark in its icon, rather than either a green dot, or the star of the other files (if lazy load selected). Visual Studio then seems to think the file has changed. The output in the Perforce Source Control window looks like the following:

->changes -l -c james -m 10 -s pending -u jamesh
->fstat I:\Workspace\example.sln
->changes -l -c james -s pending -u jamesh
->add -f i:\Workspace\example.sln
--->//depot/example.sln - can't add existing file

I can get it to have the correct state by refreshing the file, but this is obviously far from ideal, and it still thinks the file has changed. This is affecting multiple solutions, so isn't just confined to the one I'm using primarily. In all cases, the files already exist in the depot, and the projects and source files all initialise correctly.

Any idea as to what might be causing this? It's not a massive problem, but is somewhat inconvenient.

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 08 April 2015 - 11:34 PM

Hi James,

Thank you for letting us know your P4VS version. In order to better trouble-shoot, please send a screen-shot of your settings from Tools -> Options -> Source Control -> Perforce General.

Is the question mark red? If so, was this file edited or integrated recently?  The red question mark icon indicates that a resolve needs to be done on the file. See 'Using Solution Explorer with P4VS':

http://www.perforce....lution_explorer

#3 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 09 April 2015 - 08:08 AM

Hi,

Screenshot as things stand on opening the solution:


I also have the same behaviour if I tick "Lazy load file state" and reopen the solution. Ticking "Preload file state" causes it to be loaded correctly, but then the solution load takes several minutes, so I want to avoid that.

The question mark is blue. The solution doesn't need resolving (I've reverted it with no difference).

#4 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 09 April 2015 - 05:39 PM

Hi,

I don't see a screenshot. The blue icon indicates the file is not in the Perforce depot.

#5 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 10 April 2015 - 08:10 AM

That's weird - it was definitely there when I posted yesterday! The solution is definitely in the Perforce depot, so the blue question mark is clearly wrong in this case.

I've created an attachment containing the screen shot, as I can't seem to get it to appear properly in the post.

perforce_settings.PNG

#6 Warbands

Warbands

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 12 April 2015 - 08:45 AM

I too am suffering from a similar fate. I am using Unreal Engine 4 with Visual Studio 2013, and the latest P4VS. As of the latest update of P4VS, I now sit at "Initializing Project" for 2 minutes or more. If I turn off P4VS, I have maybe 5 seconds of "Initializing Project".
and P4V
The big difference seems to be that as of Unreal 4.7 they included the engine code by default, and it is part of the solution explorerer, and P4VS seems to think that it needs to be looked at, causing all the files to throw errors like this:

[Error: P4API.NET] 12/04/2015 01:43:56.9348 : Failed: Path 'c:\Program Files\Epic Games\4.7\Engine\Source\Editor\WorldBrowser\Private\LevelModel.h' is not under client's root 'C:\Users\Nakago\Perforce\Card_and_Dungeon'.

[Fatal: P4Command] 12/04/2015 01:43:56.9368 : Perforce.P4.P4Exception:Path 'c:\Program Files\Epic Games\4.7\Engine\Source\Editor\WorldBrowser\Private\LevelModel.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)

This could be remedied if P4VS could be told to ignore part of the solution explorer. This debilitating, and really needs to be addressed if possible, otherwise P4VS becomes pretty useless.

#7 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 16 April 2015 - 05:37 PM

Hi Warbands,

I saw your post also on the msdn P4VS gallery page.
To help alleviate this pain, has anyone tried the new 'Lazy Load' feature?

It was introduced in the version 2015.1 of P4VS. This feature is turned on/off via the menu Tools -> Options -> Source Control -> Perforce General.
The "Lazy Load" feature was designed to cut down load time and general performance on large projects and/or slow connections.


The doc also describes the feature here:

http://ftp.perforce....s.general.files

The P4VS release notes mention it here under New functionality in 2015.1,
1020819 (Bug 77607) *:

http://www.perforce....r/p4vsnotes.txt

Please let us know if this helps resolve your issue. Our development team would like to help and get your feedback.

#8 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 16 April 2015 - 06:20 PM

James,

Thanks for sending a screenshot of your general settings. That certainly does sound odd for a file in Perforce to display a blue question mark icon indicating it is not.

Please send a screen-shot of your solution explorer or wherever you are seeing the blue question mark icon so we can see if we notice anything that gives a clue.

Is there only one (1) file displaying like this or multiple?

Was this file(s) ever renamed in the past?

Can you confirm via P4V Depot or via command line (p4 files //depot/vsproject/file) that the file truly is reported as existing in Perforce?

Does refresh ever fix it?

What type of Visual Studio project is it? (i.e. web, c#) Does this happen on any of your other projects?

We might have to try to reproduce the issue here in case it's a bug so having your input is important.

Thanks in advance!

#9 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 16 April 2015 - 11:46 PM

Hi James,

I wanted to also mention that there should be an upcoming P4VS patch coming out in a couple weeks or so. This issue that you are seeing may be related to not having the 'preload cache' option enabled, but we do not know for sure.

#10 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 April 2015 - 09:21 AM

View PostP4Shimada, on 16 April 2015 - 06:20 PM, said:

James,

Thanks for sending a screenshot of your general settings. That certainly does sound odd for a file in Perforce to display a blue question mark icon indicating it is not.

Please send a screen-shot of your solution explorer or wherever you are seeing the blue question mark icon so we can see if we notice anything that gives a clue.

Is there only one (1) file displaying like this or multiple?

Was this file(s) ever renamed in the past?

Can you confirm via P4V Depot or via command line (p4 files //depot/vsproject/file) that the file truly is reported as existing in Perforce?

Does refresh ever fix it?

What type of Visual Studio project is it? (i.e. web, c#) Does this happen on any of your other projects?

We might have to try to reproduce the issue here in case it's a bug so having your input is important.

Thanks in advance!

Attached screenshot of an example solution explorer demonstrating this.
solution_explorer.PNG

It is only ever the solution file that shows this issue, but it appears to be every single one of our solutions in the depot. Some of these files, but not all, may have been renamed and/or moved in the past. However, the one in the screenshot hasn't been.

I can see the solutions clearly in the depot in P4V. It also shows up using p4 files on the command line.

Refresh appears to fix it every time (although it takes a few seconds for the refresh to complete in some cases due to the scale of some of our solutions).

As noted above, this only seems to affect our solution files, never our project files. For reference, our projects are all Visual C++ projects.

As noted in my original post, if I have the preload cache enabled, the problem goes away, but it can be extremely slow to load the solution for some of our solutions.

#11 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 11 May 2015 - 10:02 AM

Just thought I'd mention that I've updated to the latest version P4VS (2015.1.105.4164), and I still see this issue. I've also noticed that some other members of the team appear to have the same problem. However, at least one of them does not (that's with the same version of P4VS). I find it particularly intriguing that it tries to add the file during the load of the solution before failing.

HOWEVER

Whilst typing this post, I thought I'd see what would happen if I followed the commands in the first post that P4VS is doing, using the command line tool. I noticed this in the fstat line:

<snip>
... clientFile I:/Workspace\bt\binutils\dev\binutils.sln
<snip>

That first slash being in the wrong direction was annoying me, so I switched its direction in the workspace root to a more Windows-y style one. I then open Perforce and suddenly bam! it now works! No more blue question mark! Switch it back to the original direction again, and it's suddenly causing problems again.

For reference, I asked my colleague, whose workspace started something like: C:\Users\... to try C:/Users\... and it didn't produce the same issue.

I now have my local fix, but I expect that there are others with this issue as well, so hopefully this will provide you with enough information to reproduce the issue.

#12 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 12 May 2015 - 04:48 PM

Hi James,

Thanks for trying the new patch and also the details and update about the client workspace path having inconsistent slashes (one forward slash and the rest were back slashes).  This certainly could be the culprit and would make sense why the software would think the top directory does not exist in the depot (blue question mark) because possibly it cannot decipher the file path which has incorrect Windows syntax.

Windows uses backslashes for paths.  Some software tries to automatically correct when you type the wrong type of slash, so it may not matter which type of slash you use sometimes. However, sometimes, the difference still matters.  For example, if you type commands like

cd C:/Windows/ 

into the Command Prompt today, you will be taken to the correct folder. This does not work everywhere in Windows, however. If you type a path like:

C:/Users/Public

into the Open dialog and press Enter, you will see an error saying that the file name is not valid.

#13 OmegaNemesis28

OmegaNemesis28

    Member

  • Members
  • PipPip
  • 18 posts

Posted 20 June 2016 - 06:41 PM

Had this happen to me. And because of it, P4VS would not automatically add files when creating new ones. After correcting the workspace root from / to \, the sln edit issues went away and I would get the add file prompt on new files again.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users