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

user defined reference directory

Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file
"c:\program files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?

Sep 13 '06 #1
6 1333
Rene Sørensen wrote:
Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file
"c:\program files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?
PATH ? GAC ?

Arne
Sep 13 '06 #2
Rene,

You will want to use the <problingelement in the configuration file to
specify private sub-directories to search for assemblies in. For more
information, check out the section of the MSDN documentation titled
"<probingElement", located at:

http://msdn2.microsoft.com/en-us/library/823z9h8w.aspx

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

"Rene Sørensen" <re**@deltadk.dkwrote in message
news:qd********************************@4ax.com...
Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file
"c:\program files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?

Sep 13 '06 #3
The runtime doesn't access the PATH variable at all when loading
assemblies.

The GAC isn't what is desired here, since the OP wants private sub
directories to search for assemblies in.

The best option is to use the <probingelement in the app config file.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:2yINg.37771$_q4.10295@dukeread09...
Rene Sørensen wrote:
>Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file "c:\program
files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?

PATH ? GAC ?

Arne

Sep 13 '06 #4

Thanks for the quick response this was very helpfully.
I have another question, can I use <problingwhen I need a reference
from a "c:\program files\app\plugins\" to a dll located in "c:\program
files\app\system\". I should maybe say here that my plug-ins is dlls
On Tue, 12 Sep 2006 20:53:18 -0400, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>Rene,

You will want to use the <problingelement in the configuration file to
specify private sub-directories to search for assemblies in. For more
information, check out the section of the MSDN documentation titled
"<probingElement", located at:

http://msdn2.microsoft.com/en-us/library/823z9h8w.aspx

Hope this helps.
Sep 13 '06 #5
Rene,

As long as your app resides in "c:\program files\app" and you list
plugins and system in the probing element, your assemblies should be able to
resolve references correctly.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rene Sørensen" <re**@deltadk.dkwrote in message
news:2b********************************@4ax.com...
>
Thanks for the quick response this was very helpfully.
I have another question, can I use <problingwhen I need a reference
from a "c:\program files\app\plugins\" to a dll located in "c:\program
files\app\system\". I should maybe say here that my plug-ins is dlls
On Tue, 12 Sep 2006 20:53:18 -0400, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>>Rene,

You will want to use the <problingelement in the configuration file
to
specify private sub-directories to search for assemblies in. For more
information, check out the section of the MSDN documentation titled
"<probingElement", located at:

http://msdn2.microsoft.com/en-us/library/823z9h8w.aspx

Hope this helps.

Sep 13 '06 #6
Nicholas Paldino

Thanks for your help, you solved my problem. In my appConfig i just
needed to have multiple defines, so now it looks like this
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="system\;plugins\"/>
</assemblyBinding>
</runtime>

On Tue, 12 Sep 2006 22:48:31 -0400, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>Rene,

As long as your app resides in "c:\program files\app" and you list
plugins and system in the probing element, your assemblies should be able to
resolve references correctly.
Sep 13 '06 #7

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

Similar topics

2
by: David Emme | last post by:
Access 97 I have a number of SELECT statements which contain references to user-defined VBA functions. These typically work as expected, but occasionally, on one user's machine or another,...
5
by: Matthew Louden | last post by:
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'" error message. I then did the following, but...
5
by: z. f. | last post by:
Hi, I'm working on a web project and i create classes to do business logic and connect to DB. i also need a windows application to do the same functionality as defined in classes inside the...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
7
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb --...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
5
by: Ryan | last post by:
I'm a lot confused when using user controls in ASP.NET 2.0. How do I cast a varaible to the type of a user control... for example: ...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
3
by: taps128 | last post by:
I've been reading the namespace specification for the 5.3 relaese, and I can't stop thinking that they have complicated the thing unecessary. Here is what I mean. So far if you call a function...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...

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.