0

This code does not write anything to the console cause the collection is empty.

Project p = new Project(engine);
p.AddNewImport(@"C:\mytarget.targets","");
foreach(Import imp in p.Imports)
    Console.WriteLine(p.ProjectPath);

But!, if I debug the code the collections get the imports, I guess it has to do with timing?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
sebagomez
  • 9,501
  • 7
  • 51
  • 89

1 Answers1

0

You have to call p.Load(YOUR_REQUIRED_PARAMETER) and then you can add further imports.

Cheers Orlando

orlando
  • 16