Hi everybody. It's probably something easy, but stops me dead on
tracks.
I have no problem CreateInstance or InvokeMember on constructor when I
am loading assembly using Assembly.LoadFile.
But if I use Assembly.Load(byte[]), I cannot Invoke constructor,
cannot Activator.CreateInstance - it gives be error "Exception were
thrown by target".
Please help.
<Dmitriy Krasnikov <dmitriykrasnikov.remove this its for
spam@mtgsi.com>> wrote:
> Hi everybody. It's probably something easy, but stops me dead on
> tracks.
[quoted text clipped - 4 lines]
> thrown by target".
> Please help.
Well the first thing to do is see what exception has been thrown - look
at the InnerException property.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Dmitriy Krasnikov - 11 May 2004 16:13 GMT
> <Dmitriy Krasnikov <dmitriykrasnikov.remove this its for
>spam@mtgsi.com>> wrote:
[quoted text clipped - 9 lines]
>Well the first thing to do is see what exception has been thrown - look
>at the InnerException property.
Thank you. It gave more meaningfull message.
"Unable to generate a serializer for type wst.SqlMessage from assembly
<Unknown> because the assembly may be dynamic. Save the assembly and
load it from disk to use it with XmlSerialization."
Any workarounds possible? The problem is, if I load it from disk I
cannot delete it later and generate new.
Jon Skeet [C# MVP] - 11 May 2004 19:45 GMT
<Dmitriy Krasnikov <dmitriykrasnikov.remove this its for
spam@mtgsi.com>> wrote:
> >Well the first thing to do is see what exception has been thrown - look
> >at the InnerException property.
[quoted text clipped - 5 lines]
> Any workarounds possible? The problem is, if I load it from disk I
> cannot delete it later and generate new.
I'm afraid I don't know - I haven't done much with serialisation.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too