.NET XmlSerializer issue
Posted: Wed Dec 17, 2014 6:39 pm
Hi
After I've protected the .net assembly, it runs fine on win7 x64, but it crashes with the error on Win XP SP3 x32:
As far as I understand, the .net demands to deserialize some types in runtime, so according to .net rules it creates temp files in temp dir and generates on the fly the so-called xxx.XmlSerializers.dll assembly
but during that process, the .net consults(reads?) the original .exe which is protected by enigma tool.
Please advice what could be done to add support for other OS.
.net used is 4.0
------------------------------------------------------------------------------------------------------------------
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0009: Metadata file 'c:\Program Files\xxxxxxx\yyyy.exe' could not be opened -- 'An attempt was made to load a program with an incorrect format. '
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at xxxxx.DataIdentifierCollection.ReadFromStream(Stream content)
at xxxxx.DataIdentifierCollection.ReadFromFile(String path)
at frmMain..ctor(xxxxxx)
at xxxxx.Main(String[] args)
After I've protected the .net assembly, it runs fine on win7 x64, but it crashes with the error on Win XP SP3 x32:
As far as I understand, the .net demands to deserialize some types in runtime, so according to .net rules it creates temp files in temp dir and generates on the fly the so-called xxx.XmlSerializers.dll assembly
but during that process, the .net consults(reads?) the original .exe which is protected by enigma tool.
Please advice what could be done to add support for other OS.
.net used is 4.0
------------------------------------------------------------------------------------------------------------------
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0009: Metadata file 'c:\Program Files\xxxxxxx\yyyy.exe' could not be opened -- 'An attempt was made to load a program with an incorrect format. '
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at xxxxx.DataIdentifierCollection.ReadFromStream(Stream content)
at xxxxx.DataIdentifierCollection.ReadFromFile(String path)
at frmMain..ctor(xxxxxx)
at xxxxx.Main(String[] args)