这很奇怪,我无法重现它。
在我的代码中,我这样做了(与您相同的订阅)
private void LogSomething(ActivityInstance instance, FinishActivityEventArgs args, EventPhases phases)
{
User owner = instance.Owner;
File.AppendAllLines("c:\\temp\\info.log", new[]
{
string.Format("Activity ID: {0} owned by: {1}({2}", instance.Id, owner.Title, owner.Id)
});
List<User> performers = new List<User>(instance.Performers);
foreach (var performer in performers)
{
File.AppendAllLines("c:\\temp\\info.log", new[]
{
string.Format("Activity ID: {0} Performer: {1}({2}", instance.Id, performer.Title, performer.Id)
});
}
}
为我粗暴的伐木道歉。
这是我在 info.log 中得到的:
Activity ID: tcm:3-923-131104 owned by: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-923-131104 Performer: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-924-131104 owned by: NT AUTHORITY\SYSTEM(tcm:0-3-65552
Activity ID: tcm:3-924-131104 Performer: NT AUTHORITY\SYSTEM(tcm:0-3-65552
Activity ID: tcm:3-925-131104 owned by: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-925-131104 Performer: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-926-131104 owned by: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-926-131104 Performer: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-927-131104 owned by: NT AUTHORITY\SYSTEM(tcm:0-3-65552
Activity ID: tcm:3-927-131104 Performer: NT AUTHORITY\SYSTEM(tcm:0-3-65552
Activity ID: tcm:3-928-131104 owned by: T2011GURUV3\Administrator(tcm:0-11-65552
Activity ID: tcm:3-928-131104 Performer: T2011GURUV3\Administrator(tcm:0-11-65552
所以看起来这可能与你的环境有关?也许是特定版本的缺陷?我在使用 Hotfix Rollup 1 的 SDL Tridion 2011 SP1