You can use the GetFrameworkPath task to get the framework path so that you don't have to hard code it.
<GetFrameworkPath> <Output TaskParameter="FrameworkVersion40Path" PropertyName="FrameworkPath" /> </GetFrameworkPath> <MSBuild.ExtensionPack.Framework.ILMerge InputAssemblies="@(Input)" TargetPlatformVersion="v4" TargetPlatformdirectory="$(FrameworkPath)" />