473,378 Members | 1,409 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,378 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 1544
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
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.