473,473 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating instance of type withoguht reference to assembly

i know its possible to load an assembly and create instances of the types contained however is it possible to do this withough calling the assembly.createinstance method? but using the Activator class insted? so a reference to each assembly does not need to be maintained??
Nov 16 '05 #1
4 2249
I don't understand all you're saying, but if you want to call a method
without instantiating the class to which the method belongs you delare the
method static.

"Spike" <an*******@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
i know its possible to load an assembly and create instances of the types

contained however is it possible to do this withough calling the
assembly.createinstance method? but using the Activator class insted? so a
reference to each assembly does not need to be maintained??
Nov 16 '05 #2
What do you mean by a "reference to each assembly"? You mean a
System.Reflection.Assembly variable reference? Because Activator loads one
of those internally anyways.

-mike
MVP

"Spike" <an*******@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
i know its possible to load an assembly and create instances of the types
contained however is it possible to do this withough calling the
assembly.createinstance method? but using the Activator class insted? so a
reference to each assembly does not need to be maintained??


Nov 16 '05 #3
if u set a reference to an assembly in the project u can then use any types within that just like they were in the local project, is it possible to mimic this at runtime? as with the assembly.load u would need to make the destinction between loacal project types and types stored in each assembly as local ones could be created with activator while assembly ones would need the createinstance method of the reference to that indevidual assembly.
Nov 16 '05 #4
In C#, you can do this with Interfaces. Define an interface, and then
program against that. You only need to reference the interface assembly.
Then, at runtime, load up any assembly that has classes that implement the
interface, and instantiate from them. This will provide a strongly bound way
of handling things, and perf will be ok.

Or, go VB's way :) and have everything late bound. However, the perf of a
method call is going to be something like 100 or 1000 times worse.

-mike
MVP

"Spike" <an*******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
if u set a reference to an assembly in the project u can then use any
types within that just like they were in the local project, is it possible
to mimic this at runtime? as with the assembly.load u would need to make
the destinction between loacal project types and types stored in each
assembly as local ones could be created with activator while assembly ones
would need the createinstance method of the reference to that indevidual
assembly.


Nov 16 '05 #5

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

Similar topics

0
by: David Elliott | last post by:
I have a 3rd Party DLL that is a Win32 NOT .NET Assembly that is misbehaving. I am trying to isolate it in its own AppDomain. I got to load but can not create an instance. I receive the following...
4
by: Spike | last post by:
i know its possible to load an assembly and create instances of the types contained however is it possible to do this withough calling the assembly.createinstance method? but using the Activator...
0
by: Richard Bell | last post by:
Hosting process is dllhost. Type reference is obtained by a call to System.GetType(). Declaring assembly does not have a strong name and is located in DEVPATH. Assembly is loaded and type reference...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
0
by: Tom | last post by:
Thanks Chris : However, during run time, it show error message "File / component cannot find " during run in Dim asm As =...
2
by: Tom | last post by:
Thanks Chris : However, during run time, it show error message "File / component cannot find " during run in Dim asm As =...
2
by: salportaro | last post by:
Hello: Here is the situation. VB.NET I have several forms and I have a XML file that can start with a particular for for debugging/layout reasons. This is a mdi project. Normaly you would...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
0
by: thehitman | last post by:
I used an article "Creating a Flexible Configuration Section Handler "(http://www.15seconds.com/issue/040504.htm). The Console application works with app.config but with the web.config. The...
1
by: bowser | last post by:
Hello, I have a problem with reflection. I posted it already a month ago, but I had no luck with the answers... Having two variables: Type t; string id; initialized for example as t="Foo"...
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...
0
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.