Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

Cannot CreateInstance of Assembly after loading it with Assembly.Load(byte[])

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dmitriy Krasnikov - 11 May 2004 13:53 GMT
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.
Jon Skeet [C# MVP] - 11 May 2004 15:48 GMT
<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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.