473,394 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem with dinamically loaded assembly, (getTypes, createInstance... not working)

Hi,

I have been trying for more than 3 days to load an assembly and
execute a method from a specific class. Loading the assembly from the
GAC using it's strong name works fine but when I try to create an
instance of the class, it does'nt work. The call to createInstance
leaves my instance to nothing. I also tried to load the types using
getTypes and the I get an ReflectionLoadTypeExcetion : Unable to load
one or more types in the assembly. (Translated from french). I have
checked the name of my class and exerything seems to be fine but...

Before throwing my computer through the window, I tried to remove the
assembly and and all of its dependencies from the GAC, recompile them
and then put them back in it but nothing have changed.

Here's my code :

friend function getDALController as iDALController
Dim objMyDLL as aReflection.Assembly
dim objDALController as iDALController

'This code works fine
objMyDLL = System.Reflection.Assembly.load(("SuiviRedaction.D ata.AccessDAL,PublicKeyToken=16da4ced9daa2383,Cult ure=Neutral,Version=1.0.0.1")

'This call returns nothing
objDALController =
ctype(objMyDLL.createInstance("SuiviRedaction.Data .AccessDAL.DALController"),true),iDALController)
return objDALController
end function

Does anyone have an idea?

Thanks
Nov 22 '05 #1
0 787

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Elliott | last post by:
I am trying to load an assembly and execute a method from a class. I have listed 3 parts to the code. 1) The Driver to load and execute 2) The Interface 3) The assembly I have a valid referece...
0
by: Stephane Belzile | last post by:
Hi, I have been trying for more than 3 days to load an assembly and execute a method from a specific class. Loading the assembly from the GAC using it's strong name works fine but when I try to...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
4
by: Terry | last post by:
I'm building some dll assemblies that have in them the implementation of an abstract class defined in a different assembly. I'm trying to create objects of the type defined in the dlls with...
3
by: Daniel | last post by:
how do i access methods when the .net assembly was loaded with late biding? class Class1 { public static void Main() { System.Reflection.Assembly SampleAssembly; SampleAssembly =...
1
by: Zachary Hartnett | last post by:
I was trying to write a routine this morning that would open a given assembly, walk the inheritance tree of classes in the assembly, and provide a list of classes in the assembly that inherit from...
6
by: mookid8000 | last post by:
Hi group! Is it possible to scan an assembly *which has NOT been added as a reference* for types, and dynamically create instances of the loaded types? I have a program, MyProgram.exe, which...
1
by: Manuela Abele | last post by:
Hello everybody, I have a problem with interface and I need urgent your help. public interface IKoerper { // Properties int laenge { get; } int breite { get; } int hoehe { get; }
19
by: Larry Smith | last post by:
Hi there, When I run the following on my app's primary thread: System.Type.GetType("System.Windows.Forms.Form") It works as expected. If I then launch a thread via the "BackgroundWorker"...
2
by: Peted | last post by:
I have 2 samples of code bellow that work fine at the moment the first routine loads an dll assembley and instantiates the type in the dll which is always a form, and creates a child form from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.