Jump to content


P4API.Net connects differently in 2017.1


  • Please log in to reply
2 replies to this topic

#1 DaveCh

DaveCh

    Member

  • Members
  • PipPip
  • 21 posts

Posted 17 July 2017 - 01:07 PM

Hi,

Just wondering if a change to P4API.Net in the way it connects was intentional or is a bug?

I have an old c# program that does minimal setup to connect to the server, just this really:

using Perforce.P4;
...
Repository repo = new Repository(new Server(new ServerAddress("MYSERVERADDRESS")));
repo.Connection.UserName = "MYUSERNAME";
repo.Connection.Connect(null);

At this point on 2016.2 and prior, repo.Connection.Client is a valid usable client (maybe the first in the list, or the last used in P4V, or environment, or whatever).

In 2017.1 after running the same code, repo.Connection.Client is null and, strangely, my P4CLIENT environment variable has been cleared out so I use "P4V/Connection/Environment Settings" to restore it.

I know your example code sets up the client name before connecting and mine doesn't (and probably needs fixing), just wanted to check if you were aware of this difference, especially with it clearing out the P4CLIENT environment variable (which seems a bit extreme :) )

Dave

#2 p4bill

p4bill

    Advanced Member

  • Members
  • PipPipPip
  • 111 posts

Posted 24 July 2017 - 04:23 PM

Hi Dave,

There were changes to the way P4API.NET handles connections, but the repo.Connection.Client being null and cleared in the environment is a bug. I'm logging an issue here and we'll be investigating it. Thanks for the detailed information.

#3 DaveCh

DaveCh

    Member

  • Members
  • PipPip
  • 21 posts

Posted 03 August 2017 - 09:18 AM

Got a notification this morning that a new P4API.Net was out (2017.1 Patch1 1537030) so tried it out and this Client problem is fixed :)

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users