By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

DLL files location

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.