473,386 Members | 1,766 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,386 software developers and data experts.

Can i give alias to a dll?


Hi,

My host application loading plugins at runtime
How can I dynamically load types from a dll without
specify the name of the dll in my application or in a config file
can I give a dll an alias?

assuming i have two implemnatations of a messaging service(only one should
be installed)

1.smtp.dll
2.exchange.dll

insetad of
LoadType("smtp.dll")

I would like to write
LoadType("Messaging")

when installing the exchange.dll i will still uses

LoadType("Messaging")

Thanks.
BTW:I do specify the type of object to create in the app.config.
Jul 21 '05 #1
2 1545
Julia wrote:
Hi,

My host application loading plugins at runtime
How can I dynamically load types from a dll without
specify the name of the dll in my application or in a config file
can I give a dll an alias?

assuming i have two implemnatations of a messaging service(only one should
be installed)

1.smtp.dll
2.exchange.dll

insetad of
LoadType("smtp.dll")

I would like to write
LoadType("Messaging")

when installing the exchange.dll i will still uses

LoadType("Messaging")

Thanks.
BTW:I do specify the type of object to create in the app.config.


<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="Messaging" value="smtp.dll" />
</appSettings>
LoadType(ConfigurationSetting.AppSettings["Messaging"]);

bye
Rob
Jul 21 '05 #2
Julia,

The closest you can come to this would be to call the static
LoadWithPartialName method on the Assembly class, and make sure that the
assembly is loaded in the GAC. In this case, you could do something like:

// Get System.Data.dll.
Assembly a = Assembly.LoadWithPartialName("System.Data");

However, AFAIK, you can't set an alias up.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Julia" <co********@012.net.il> wrote in message
news:Og**************@TK2MSFTNGP15.phx.gbl...

Hi,

My host application loading plugins at runtime
How can I dynamically load types from a dll without
specify the name of the dll in my application or in a config file
can I give a dll an alias?

assuming i have two implemnatations of a messaging service(only one should
be installed)

1.smtp.dll
2.exchange.dll

insetad of
LoadType("smtp.dll")

I would like to write
LoadType("Messaging")

when installing the exchange.dll i will still uses

LoadType("Messaging")

Thanks.
BTW:I do specify the type of object to create in the app.config.

Jul 21 '05 #3

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

Similar topics

14
by: John | last post by:
Hi all, I am doing the change from having worked in Oracle for a long time to MS SQL server and am frustrated with a couple of simple SQL stmt's. Or at least they have always been easy. The...
2
by: Julia | last post by:
Hi, My host application loading plugins at runtime How can I dynamically load types from a dll without specify the name of the dll in my application or in a config file can I give a dll an...
5
by: Alias | last post by:
Hi - I'm trying to implement a custom RoleProvider based on the SqlRoleProvider. I keep receiving a an error that it can't load type 'MyRoleTest.MyRoleProvider' when trying to load my...
1
by: dwasler | last post by:
Try every thing I know to remove this alias I know there been other posting I read each one none seem to work. Thank You DLWasler dwasler@yahoo.com OS Window db2 V 8.2.X
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.