I am trying to merge some .net assemblies for Windows Phone 8 using ILMerge.exe (2.12.0803). On their own all assemblies work fine. I can successfully merge assembles which do not contain references to the Windows.Networking namespace as follows:
.\ILMerge.exe /lib:"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0" /out:.\WP8\%1\MathToolbox.dll .\%1\MathBase.dll .\%1\PolyFunctions.dll
As soon as I try to include a DLL which uses the Windows.Networking namspace as follows:
.\ILMerge.exe /lib:"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0" /out:.\WP8\%1\MathToolbox.dll .\%1\MathBase.dll .\%1\PolyFunctions.dll .\%1\RemoteTools.dll
I am recieving the following exception:
An exception occurred during merging: Unresolved assembly reference not allowed: Windows. at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly) at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type) at System.Compiler.Ir2md.VisitReferencedType(TypeNode type) at System.Compiler.Ir2md.VisitClass(Class Class) at System.Compiler.Ir2md.VisitModule(Module module) at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation) at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer) at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delayS ign, String keyFileName, String keyName) at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module) at ILMerging.ILMerge.Merge() at ILMerging.ILMerge.Main(String[] args)
Having done some reading this exception suggets ILMerge is unable to locate the Windows.Networking assemblies. I have attempted adding various different flags to ILMERGE including:
.\ILMerge.exe /lib:"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0" /targetplatform:v4,"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71" /out:.\WP8\%1\MathToolbox.dll .\%1\MathBase.dll .\%1\PolyFunctions.dll .\%1\RemoteTools.dll
But still get the same exception. If anyone has any suggestions that would be greatly appreciated.