I tried this, there is nothing listed in the log at all.
Also, if I choose anything but "Default" from the radio
button list on the right, I get an error that says:
"Error: Unable to open cache file!"
I am using the full name of the Firebird driver. If I
switch to SQL Server, it also fails.
But...in the very same class, this method runs and works
just fine, which seems very strange to me:
public IDataHelper Create()
{
//get configuration values for the assembly and class
string assemblyName = Config.DataHelperFactoryAssembly;
string className = Config.DataHelperFactoryClass;
//load the assembly and class
IDataHelper dh =
(IDataHelper)Assembly.Load(assemblyName).CreateIns tance(className);
return dh;
}
Config.DataHelperFactoryAssembly and
Config.DataHelperFactoryClass call an assembly & class I
that I wrote myself.....and it works.
What's the problem with calling external assemblies?
I would use LoadFrom but I need it to be more flexible than
that...I can't very well make it portable if I have to
worry about paths breaking to my assemblies.
Thanks!
-----Original Message-----
V. Jenks wrote: I'm using reflection to dynamically load an assembly and
even though I'm sure the assembly is present, I keep
getting an error telling me the "assembly or one of its
references can't be found".
I do in fact have a reference to the assembly in question
in the project and I even tried declaring it with "using"
at the top of the class file.
Here's the method that fails:
public IDataAdapter CreateAdapter(string query,
IDbConnection connection)
{
object[] args = {query, connection};
//load the assembly and class
Assembly asmb =
Assembly.Load("FirebirdSql.Data.Firebird");
Type type = asmb.GetType("FbDataAdapter");
IDataAdapter da = Activator.CreateInstance(type, args)
as IDataAdapter;
return da;
}
The "FirebirdSql.Data.Firebird" assembly can't be found,
even though it's there. It's in my GAC and available as
I'm using it elsewhere w/o a problem.
Start the tool fuslogvw.exe and examine the log fusion
has written whenit failed to load the assembly. As the firebird provider
is signed,perhaps you should specify it's full name. Either way, the
log willexplain what paths it has checked and for which file.
Fuslogvw.exe is part of the .net sdk and if you have
vs.net installedon your system you have it installed as well.
Frans.
--
Get LLBLGen Pro, productive O/R mapping for .NET:
http://www.llblgen.comMy .NET Blog : http://weblogs.asp.net/FBouma
Microsoft MVP (C#)
.