Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet framework > july 2004 >

dotnet framework : Assembly.Load & Petshop conversion.


Mike
7/27/2004 6:36:08 PM
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?
v-phuang NO[at]SPAM online.microsoft.com (
7/28/2004 7:28:06 AM
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/archive/2003/05/29/57120.aspx

Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn.microsoft.com/library/default.asp?url=/library/en-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.
Mike
7/28/2004 12:28:43 PM
I figured out the problem. It turns out I was missing a section in my .config
file, which did the trick.


In article <Fm6S8RHdEHA.3424@cpmsftngxa10.phx.gbl>, Peter Huang says...
[quoted text, click to view]
AddThis Social Bookmark Button