1
P4Command cm = new P4Command(ps, "sync", true, String.Format("{0}/...", deppath));
P4CommandResult results = cm.Run();

if (results != null)
    Console.WriteLine("no problem");

TaggedObjectList listfiledown = new TaggedObjectList();
listfiledown = (results.TaggedOutput);

foreach (TaggedObject obj in listfiledown)
{
    Console.WriteLine("no problem");
}

I have to download a file from the depot to my workspace, so if i run the command the taggedoutput is null , is there any solution for that?

'Object reference not set to an instance of an object'

Soner Gönül
  • 91,172
  • 101
  • 184
  • 324
  • Which line throws this exception? You can read [`What is a NullReferenceException in .NET?`](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net) – Soner Gönül Mar 21 '13 at 08:51
  • the taggedobjectlist is null so the exception was throwen in the the foreach –  Mar 21 '13 at 08:54
  • knowing that other commands works with files that are in my workspace –  Mar 21 '13 at 08:56

1 Answers1

0

So, your command have returns a null results.TaggedOutput. I'd run under debugger, break after cm.Run(), and look at results to see whether it contains some kind of error description.

Failing that, check that your command is correct - for example, that deppath points to the correct path.

Jonathan
  • 5,855
  • 3
  • 34
  • 54