Jump to content


P4VS prompts to save VS solution every time.

P4VS Solution VisualStudio

  • Please log in to reply
7 replies to this topic

#1 kbrizov

kbrizov

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 10 July 2018 - 07:40 AM

Hello guys,

I installed the P4VS extension from NuGet. After that, I managed to connect to a Perforce Depot and a Workplace. Every time I open my VS solution (.sln) I get prompted to connect. I connect successfully and everything works. What is bothering me is that every time I close my Visual Studio I get prompted to save my solution as if I have modified it. No matter what option I select (Save, Don't save) the next time I open and later close the solution I get prompted to save again. It seems that the .sln file is not modified at all. This can be troublesome because my workflow involves a lot of opening/closing my solution. Put that aside and there is a bigger issue. This means that I can potentially save a .sln change I made by mistake and I wouldn't even know. Perhaps something in my configuration is wrong. I have a .p4ignore file that ignores the solution file, but nothing I did solves the issue. It seems that the .sln file does not have a read-only flag. Anyone else experiencing this? I'm using Visual Studio 2017 community.

Best regards,
Chris.

#2 p4bill

p4bill

    Advanced Member

  • Members
  • PipPipPip
  • 154 posts

Posted 11 July 2018 - 09:17 PM

Hello,

It sounds like you have the solution ignored, so it will not be added to a Perforce depot. Since it is not checked in, it will be writable without being checked out. What could be happening is that P4VS  is writing source control information to the .suo file and Visual Studio reads this as an edit of the solution file.

A few questions:

What version of P4VS are you using? This can be found on the connection dialog.

Do you not want to have the .sln file under source control? (i.e. the ignore was intentional and not just an attempt to stop the prompt to save the file).

Could you confirm that this does not happen if you disable P4VS. Tools->Extensions and Updates: select P4VS [Disable] and restart Visual Studio.

Can you confirm that the file is not changed? Open the .sln in a text editor, save it as a different name, Open the .sln in Visual Studio and save it when closing the solution. Then diff the 2 .sln files

#3 agraham

agraham

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 19 July 2018 - 09:08 PM

I'm having this problem too.

#4 p4bill

p4bill

    Advanced Member

  • Members
  • PipPipPip
  • 154 posts

Posted 19 July 2018 - 09:12 PM

Are either of you able to respond to the additional questions above? We first want to confirm that the solution file itself has not changed in this scenario.

#5 m_parker

m_parker

    Newbie

  • Members
  • Pip
  • 5 posts
  • LocationChicago, IL

Posted 19 July 2018 - 10:39 PM

I am seeing the same issue.  First, when prompting to save, VS wanted to add a section like this every time at the bottom of the solution:
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {D3DAA774-B248-4D09-BCC5-9536C04AB3AC}
	EndGlobalSection
but we then checked it in with this and now it prompts to check out but the files are identical.  It seems to prompt at the time when the user first builds it.
  • P4VS version 2018.2.166.5359
  • Solution not in ignore file, marked as controlled by P4VS
  • With P4VS disabled, there is no prompt and it builds fine.
  • The file is definitely unchanged.


#6 p4bill

p4bill

    Advanced Member

  • Members
  • PipPipPip
  • 154 posts

Posted 20 July 2018 - 08:59 PM

Thanks for the details. This will be fixed in our next release, which should be out soon (before the end of July).

#7 m_parker

m_parker

    Newbie

  • Members
  • Pip
  • 5 posts
  • LocationChicago, IL

Posted 13 September 2018 - 09:28 PM

I'm still seeing this in 2018.3.169.7626, installed on 9/7/18.  Was the fix ever released?

#8 p4bill

p4bill

    Advanced Member

  • Members
  • PipPipPip
  • 154 posts

Posted 18 September 2018 - 07:00 PM

View Postm_parker, on 13 September 2018 - 09:28 PM, said:

I'm still seeing this in 2018.3.169.7626, installed on 9/7/18.  Was the fix ever released?

Yes, the issue that I was able to reproduce was fixed in the 2018.3 release:

	 1668006 (Bug #95573) *
		 When P4VS cannot get user and source control information from
		 Visual Studio solution load events, it no longer attempts to
		 re-register the .sln file.

The P4VS package was changed to load asynchronously in 2018.2, which results in P4VS no longer getting information from solution load events. The attempt to re-register the .sln resulted in it being checked out (or at least prompted to be checked out).

This bug would be surfaced when:

1. Visual Studio is launched by opening a .sln under source control
2. The setting in Tools -> Options ->Source Control->Perforce-Connections () Connect to the server using solution-specific settings.

Could you provide your repro steps? You can also send info to support@perforce.com and copy bbaffy at same, so that we can investigate more thoroughly.





Also tagged with one or more of these keywords: P4VS, Solution, VisualStudio

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users