Hi Miguel
You need to provide the TargetPlatformDirectory too, e.g.
TargetPlatformVersion="v4" TargetPlatformdirectory="c:\Windows\Microsoft.NET\Framework\v4.0.30319"
I'll update the docs to make it more explicit.
re 1: Not with current task, but you could write an (inline) task to get the info and then pass it to the ILMerge task,
re 2: Sorry, I've not worked with T4 for many years though if I remember correctly there was little that couldn't be done with it :-)
Mike