Jump to content


SyncFiles throwing object reference not set

.net api sync

  • Please log in to reply
2 replies to this topic

#1 vijai_ge

vijai_ge

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 08 October 2013 - 08:17 AM

Hi,
i want to update the workspace with latest stream revision, i tried with

Perforce.P4.Client client = new Perforce.P4.Client();
client = rep.GetClient("myclient");
int max=1000;
Options sFlags = new Options(SyncFilesCmdFlags.Force, max);

FileSpec fs = new FileSpec();
LocalPath lp = new LocalPath(client.Root);
fs.LocalPath = lp;

client.SyncFiles(sFlags, fs);
the above line throwing "Object reference not set to an instance of an object". What is that i'm missing in this. Please guide me.

Thanks.
Vijai.S

#2 vijai_ge

vijai_ge

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 08 October 2013 - 11:26 AM

Got it. Works now. Missed to associate the client object with connection. Thanks.

#3 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 08 October 2013 - 04:02 PM

Glad you you got it! I have to admit I wasn't seeing the issue looking at the code.





Also tagged with one or more of these keywords: .net api, sync

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users