1

Closed

BUG: Fix .NET 4.0 ILmerge when using VS2015/Roslyn

description

The ILMerge Task does not pass the correct Platform Directory when targeting .NET 4.0 and running under VS2015 or using the Roslyn compiler with .NET 4.5

Although ILMerge is passed 'v4', the directory it is passed contains the 4.5 assemblies on a machine with 4.5 installed (since 4.5 is an in-place upgrade)
c:\windows\Microsoft.NET\Framework\v4.0.30319

This breaks Extension methods since the Extension attribute has moved to mscorelib - see:
http://www.hurryupandwait.io/blog/what-you-should-know-about-running-ilmerge-on-net-4-5-assemblies-targeting-net-4-0

Instead the Task should pass the reference assemblies for the 4.0 framework when targeting v4

The fix may be as simple as:
private string GetTargetPlatformDirectory(string value)
{
return ToolLocationHelper.GetPathToReferenceAssemblies(this.GetTargetPlatform(this.TargetPlatform));
}
Closed Dec 11, 2015 at 10:13 AM by archnae

comments