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

DLL files location

Hi All,

i found that all the referenced DLL files should be in the same folder of
the execute file
what can i do if i want all referenced DLL files located in a different path
to the execute file??

Thanks,
Ivan
Nov 20 '05 #1
7 1690
Ivan wrote:
i found that all the referenced DLL files should be in the same folder of
the execute file
what can i do if i want all referenced DLL files located in a different path
to the execute file??


Hi Ivan,

have a look at the <assemblyBinding> and <probing>-tag in your
app.config file.

Reference:
http://msdn.microsoft.com/library/en...blybinding.asp

Explanation by Don Box:
http://www.awprofessional.com/articl...30601&seqNum=6

Cheers

Arne Janning
Nov 20 '05 #2
Hi Arne Janning,

First of all, Thanks for ur reply
so i have to creat a configuration file which is the same name as my startup
executable file
like MIR.exe with MIR.exe.config with the following code
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<runtime>
<asm:assemblyBinding>
<asm:probing privatePath="System;sPortal" />
</asm:assemblyBinding>
</runtime>
</configuration>

BUT one problem.. i put the configuration file in the same project with
MIR.exe but it seems not built..
i can't find the output file and it is not working...
did i do something wrong ??.. and what should i do to make it work??

Thanks,
Ivan


"Arne Janning" <sp*****************@msn.com> ???
news:%2****************@TK2MSFTNGP12.phx.gbl ???...
Ivan wrote:
i found that all the referenced DLL files should be in the same folder of the execute file
what can i do if i want all referenced DLL files located in a different path to the execute file??
Hi Ivan,

have a look at the <assemblyBinding> and <probing>-tag in your
app.config file.

Reference:

http://msdn.microsoft.com/library/en...blybinding.asp
Explanation by Don Box:
http://www.awprofessional.com/articl...30601&seqNum=6

Cheers

Arne Janning

Nov 20 '05 #3
Ivan wrote:
First of all, Thanks for ur reply
so i have to creat a configuration file which is the same name as my startup
executable file
like MIR.exe with MIR.exe.config with the following code
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<runtime>
<asm:assemblyBinding>
<asm:probing privatePath="System;sPortal" />
</asm:assemblyBinding>
</runtime>
</configuration>

BUT one problem.. i put the configuration file in the same project with
MIR.exe but it seems not built..
i can't find the output file and it is not working...
did i do something wrong ??.. and what should i do to make it work??


Hi Ivan,

MIR.exe.config does not have to be "built". Simply copy the
MIR.exe.config into the _same_ directory where your MIR.exe is.

With the example you provided the CLR loader will search your dll in
these directories:

APPDIR\yourdll.dll
APPDIR\yourdll\yourdll.dll
APPDIR\System\yourdll.dll
APPDIR\System\yourdll\yourdll.dll
APPDIR\sPortal\yourdll.dll
APPDIR\sPortal\yourdll\yourdll.dll

If your dll is culture-dependent (e.g. "en-US") then the CLR loader will
search in these directories:

APPDIR\en-US\yourdll.dll
APPDIR\yourdll\en-US\yourdll.dll
APPDIR\System\en-US\yourdll.dll
APPDIR\System\yourdll\en-US\yourdll.dll
APPDIR\sPortal\en-US\yourdll.dll
APPDIR\sPortal\yourdll\en-US\yourdll.dll

Is your dll located in one of these directories? If so it should work.

Cheers

Arne Janning
Nov 20 '05 #4
Arne Janning,

still not working.. but i'm sure ur method work fine.. i just don't know
which part i did wrong
let me tell u my structure in detail

C:\AppFolder <== this is the application folder which contains Main.EXE
(executable file) and Main.EXE.Config
that is:- C:\AppFolder\Main.EXE
C:\AppFolder\Main.EXE.Config
C:\AppFolder\System <== this folder contain all the dll reference files
including some dll files that Main.EXE referenced
that is:- C:\AppFolder\System\Kernel.Database
C:\AppFolder\System\Kernel.Global

Main.EXE.Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<asm:assemblyBinding>
<asm:probing privatePath="System" />
</asm:assemblyBinding>
</runtime>
</configuration>

do u know where i make the mistake??
does it make any problem if Main.EXE contain reference to Kernel.Global ???

Many thanks,
Ivan
"Arne Janning" <sp*****************@msn.com> ???
news:e%****************@tk2msftngp13.phx.gbl ???...
Ivan wrote:
First of all, Thanks for ur reply
so i have to creat a configuration file which is the same name as my startup executable file
like MIR.exe with MIR.exe.config with the following code
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<runtime>
<asm:assemblyBinding>
<asm:probing privatePath="System;sPortal" />
</asm:assemblyBinding>
</runtime>
</configuration>

BUT one problem.. i put the configuration file in the same project with
MIR.exe but it seems not built..
i can't find the output file and it is not working...
did i do something wrong ??.. and what should i do to make it work??


Hi Ivan,

MIR.exe.config does not have to be "built". Simply copy the
MIR.exe.config into the _same_ directory where your MIR.exe is.

With the example you provided the CLR loader will search your dll in
these directories:

APPDIR\yourdll.dll
APPDIR\yourdll\yourdll.dll
APPDIR\System\yourdll.dll
APPDIR\System\yourdll\yourdll.dll
APPDIR\sPortal\yourdll.dll
APPDIR\sPortal\yourdll\yourdll.dll

If your dll is culture-dependent (e.g. "en-US") then the CLR loader will
search in these directories:

APPDIR\en-US\yourdll.dll
APPDIR\yourdll\en-US\yourdll.dll
APPDIR\System\en-US\yourdll.dll
APPDIR\System\yourdll\en-US\yourdll.dll
APPDIR\sPortal\en-US\yourdll.dll
APPDIR\sPortal\yourdll\en-US\yourdll.dll

Is your dll located in one of these directories? If so it should work.

Cheers

Arne Janning

Nov 20 '05 #5
On Fri, 30 Jul 2004 17:34:45 +0800, Ivan wrote:
still not working.. but i'm sure ur method work fine.. i just don't know


When you add the config file to the project name it "app.config". When you
build the project, VS will AUTOMATICALLY rename the .config file
appropriately and copy it to the output folder.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 20 '05 #6
Hi Chris,

Thanks for your reply,
What u said is correct but it doesn't make any help to make my program
works...
Is there any problem if the Main.EXE referenced to some DLL files which are
not in the same folder??
Or do you have any other idea?... I'm still struggling in it... sigh......

Thanks,

Ivan


"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> ???
news:1e*****************************@40tude.net ???...
On Fri, 30 Jul 2004 17:34:45 +0800, Ivan wrote:
still not working.. but i'm sure ur method work fine.. i just don't
know
When you add the config file to the project name it "app.config". When you build the project, VS will AUTOMATICALLY rename the .config file
appropriately and copy it to the output folder.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 20 '05 #7
Hi Chris,

Thanks for your reply,
What u said is correct but it doesn't make any help to make my program
works...
Is there any problem if the Main.EXE referenced to some DLL files which are
not in the same folder??
Or do you have any other idea?... I'm still struggling in it... sigh......

Thanks,

Ivan


"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> ???
news:1e*****************************@40tude.net ???...
On Fri, 30 Jul 2004 17:34:45 +0800, Ivan wrote:
still not working.. but i'm sure ur method work fine.. i just don't
know
When you add the config file to the project name it "app.config". When you build the project, VS will AUTOMATICALLY rename the .config file
appropriately and copy it to the output folder.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 20 '05 #8

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

Similar topics

4
by: Samuel | last post by:
I am building an web application that will be hosted on load balanced servers (multiple front and one backen db). The application will have to allow users to upload files onto the server. For...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
16
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
3
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with...
5
by: p309444 | last post by:
Hi. I have an application in which the user can select a location and view it's distance from several Points Of Interests (POIs). When I retrieve these distances, I would also like to retrieve...
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: 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: 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,...
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.