473,569 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ReflectionLoadT ypeExcetion : 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 getDALControlle r as iDALController
Dim objMyDLL as aReflection.Ass embly
dim objDALControlle r as iDALController

'This code works fine
objMyDLL = System.Reflecti on.Assembly.loa d(("SuiviRedact ion.Data.Access DAL,PublicKeyTo ken=16da4ced9da a2383,Culture=N eutral,Version= 1.0.0.1")

'This call returns nothing
objDALControlle r =
ctype(objMyDLL. createInstance( "SuiviRedaction .Data.AccessDAL .DALController" ),true),iDALCon troller)
return objDALControlle r
end function

Does anyone have an idea?

Thanks
Nov 22 '05 #1
0 790

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

Similar topics

4
11668
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 to the assembly. When I try to create an instance of the class, it returns a null value. Any help would be appreciated.
0
1593
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 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...
28
5183
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(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I...
4
6695
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 "Activator.CreateInstance". Everything was working fine until I started to fill out the class def with some implementation. At some point the...
3
1527
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 = System.Reflection.Assembly.LoadFrom("C:\\SimpleSolutions\\asmload\\asmtoload \\bin\\Debug\\asmtoload.dll");
1
2783
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 DataSet. Here is a snippet from the routine I came up with: ------------------------------------------------------------...
6
2276
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 at runtime uses Asseembly.LoadFile(...) to load an assembly, MyAssembly.dll. When MyAssembly.dll is added as a reference to the MyProgram project,...
1
1241
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
1579
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" class immediately after the above call, and invoke the above again as soon as the thread starts, it now returns null instead. Can anyone explain this....
2
1733
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 it. I need to use latebinfing becasue the dll to be loaded is selected by the user but is allways a dll with a form class and always instantiated...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.