Trying to ILMerge project that contains Zxing.NET package:
"C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" CommandLineDecoder.exe zxing.dll zxing.presentation.dll /out:CommandLineDecoder2.exe
Got error:
An exception occurred during merging:
Unresolved assembly reference not allowed: System.Numerics.
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.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 delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
Why I'm getting this error? What does it means? How to fix that?
From https://github.com/dotnet/ILMerge:
I expect you are using a class from System.Numerics that is not available in v4.0 and you need to change the target platform, either in code:
or using the command line:
Where the first argument is the platform version, and the second argument is the directory in which mscorlib.dll is to be found.
The relevant section of the documentation:
https://github.com/dotnet/ILMerge/blob/master/ilmerge-manual.md#221-settargetplatform