V
V&G
FileStream fs = new FileStream(fileName, FileMode.Open,
FileAccess.Read);
Byte[] body = new Byte[(int)fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Assembly assembly = Assembly.Load(body);
This code cause BadImageFormatException. An error message is:
"A BadImageFormatException has been thrown while parsing the signature.
This is likely due to lack of a generic context. Ensure
genericTypeArguments and genericMethodArguments are provided and
contain enough context."
InnerException:
"An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)"
My target is to load an assembly and serialize it for future proposes.
So I can not use LoadFrom() directly.
Do anybody have any suggestions?
Thanks for all
FileAccess.Read);
Byte[] body = new Byte[(int)fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Assembly assembly = Assembly.Load(body);
This code cause BadImageFormatException. An error message is:
"A BadImageFormatException has been thrown while parsing the signature.
This is likely due to lack of a generic context. Ensure
genericTypeArguments and genericMethodArguments are provided and
contain enough context."
InnerException:
"An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)"
My target is to load an assembly and serialize it for future proposes.
So I can not use LoadFrom() directly.
Do anybody have any suggestions?
Thanks for all