0

I've created a small console application using p4api.net which builds a changelist of files having particular attributes. So far so good, but it's unable to connect if I already have an existing connection open (like if I have an open instance of P4V, for example).

Is there a way to attach to an existing P4 connection, rather than having to close that connection and create a new one within my app?

Ganesh Sittampalam
  • 28,821
  • 4
  • 79
  • 98
phoff
  • 173
  • 1
  • 10
  • Do you get any sort of error or exception? – Mike O'Connor Oct 10 '13 at 20:02
  • I did get an exception when trying to initialize the connection, but I'm afraid I can't remember what it was and don't have time to try and recreate it at the moment. The exception text wasn't at all helpful, though. I stumbled on the answer by accident when trying to figure out how to use the P4 environment variables. – phoff Oct 14 '13 at 22:25
  • That's really strange, but glad you found a solution! – Mike O'Connor Oct 15 '13 at 15:30

1 Answers1

1

The issue seems to be that I was attempting to create a new connection to a repository I was already connected to. I found that if I leave the port/server, client/workspace, and user fields as empty strings when initializing the connection it would take those settings from my P4 environment variables and connect correctly, regardless of whether I had a connection already open or not.

phoff
  • 173
  • 1
  • 10