PC Review


Reply
Thread Tools Rate Thread

Assembly.Load & Petshop conversion.

 
 
Mike
Guest
Posts: n/a
 
      28th Jul 2004
Hi all,

I'm trying to convert Petshop v3 to VB.NET

The following line is supposed to return an instance of a class, where path is
the DLL and className is the class within said DLL.

return (PetShop.IDAL.IAccount) Assembly.Load(path).CreateInstance(className);

For example, if path = "PetShop.SQLServerDAL" and className =
"PetShop.SQLServerDAL.Account", then the code will return an instance of:

PetShop.SQLServerDAL.Account


This works fine, and but in my VB implementation, I'm getting an error from

System.Reflection.Assembly.Load(path)

"Run-time exception thrown : System.IO.FileNotFoundException - File or assembly
name WebAccess.SQLServerDAL, or one of its dependencies, was not found."

I even added those DLL's to the GAC, and still am getting the error.

Any suggestions?

 
Reply With Quote
 
 
 
 
Peter Huang
Guest
Posts: n/a
 
      28th Jul 2004
Hi Mike,

Do you mean on the same machine, the code line below will work
return (PetShop.IDAL.IAccount)
Assembly.Load(path).CreateInstance(className);

while the code line below will not work
System.Reflection.Assembly.Load(path)

and the path are of the identity value?

This seems to be a fusion failure error you may try to take a look at the
link below to see if this helps you?
Debugging Assembly Loading Failures
http://blogs.msdn.com/suzcook/archiv.../29/57120.aspx

Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfFusionLogViewerFuslogvwexe.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      28th Jul 2004
I figured out the problem. It turns out I was missing a section in my .config
file, which did the trick.


In article <(E-Mail Removed)>, Peter Huang says...
>
>Hi Mike,
>
>Do you mean on the same machine, the code line below will work
>return (PetShop.IDAL.IAccount)
>Assembly.Load(path).CreateInstance(className);
>
>while the code line below will not work
>System.Reflection.Assembly.Load(path)
>
>and the path are of the identity value?
>
>This seems to be a fusion failure error you may try to take a look at the
>link below to see if this helps you?
>Debugging Assembly Loading Failures
>http://blogs.msdn.com/suzcook/archiv.../29/57120.aspx
>
>Assembly Binding Log Viewer (Fuslogvw.exe)
>http://msdn.microsoft.com/library/de...us/cptools/htm
>l/cpgrfFusionLogViewerFuslogvwexe.asp
>
>Best regards,
>
>Peter Huang
>Microsoft Online Partner Support
>
>Get Secure! - www.microsoft.com/security
>This posting is provided "AS IS" with no warranties, and confers no rights.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Assembly.Load get returns wrong assembly. =?Utf-8?B?VmxhZCBIcnlib2s=?= Microsoft Dot NET Framework 13 1st Feb 2007 12:40 PM
Using Assembly.Load(byte[]) to load multiple versions of dll, and AppDomain.AssemblyResolve Stephen Ahn Microsoft Dot NET Framework 1 8th May 2006 10:35 AM
Diif Assembly.Load and Assembly.LoadFrom =?Utf-8?B?R3VqanU=?= Microsoft VB .NET 1 22nd Jul 2005 09:54 AM
How to use Assembly.LoadFile to load assembly in different path? =?Utf-8?B?bGVlenE=?= Microsoft Dot NET Framework 0 19th Jun 2004 07:23 AM
Cannot CreateInstance of Assembly after loading it with Assembly.Load(byte[]) Dmitriy Krasnikov Microsoft Dot NET Framework 3 11th May 2004 07:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.