473,326 Members | 2,337 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,326 software developers and data experts.

C# App Runtime library path

Hello,
How does the C# App search the library in the runtime?
Say, I build a C# App A, which use B.dll, and B.dll use the C.dll.
I specify the B.dll and C.dll path in the IDE, and build was passed.
If I run the app, do I need to put the B.dll and C.dll in the same
directory with the App?
How does the app search the library which he need?
Or, is there some environment variable of Library Path in .NET, like
"LD_LIBRARY_PATH" in UNIX?

Jun 26 '07 #1
2 2786
Someone who's read the spec will be able to give you a more detailed answer
than this, but my rule of thumb is that the .NET Framework looks first in
the GAC and then, if it can't find the assembly there, it looks in the same
directory as the calling executable. If you are using VS, the dlls will be
put in the right places for you.

So, in your example, if none of the assemblies is in the GAC, the Framework
will look for both dlls in the directory holding A.exe. The paths you
specify in the IDE are irrelevant AFAIK.

Cheers
Peter

"sealo" <se*****@gmail.comwrote in message
news:11*********************@a26g2000pre.googlegro ups.com...
Hello,
How does the C# App search the library in the runtime?
Say, I build a C# App A, which use B.dll, and B.dll use the C.dll.
I specify the B.dll and C.dll path in the IDE, and build was passed.
If I run the app, do I need to put the B.dll and C.dll in the same
directory with the App?
How does the app search the library which he need?
Or, is there some environment variable of Library Path in .NET, like
"LD_LIBRARY_PATH" in UNIX?

Jun 26 '07 #2
Hi,

"sealo" <se*****@gmail.comwrote in message
news:11*********************@a26g2000pre.googlegro ups.com...
Hello,
How does the C# App search the library in the runtime?
Say, I build a C# App A, which use B.dll, and B.dll use the C.dll.
I specify the B.dll and C.dll path in the IDE, and build was passed.
If I run the app, do I need to put the B.dll and C.dll in the same
directory with the App?
The IDE will copy the dll to the .exe's folder (unless otherwise
especified).
If you need create a setup project it will include all the needed components
to run your app.

Jun 26 '07 #3

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

Similar topics

2
by: Coy Howe | last post by:
I have an access program I would like to distribute to many computers that do not have access. I have Office Developer and have used the Packaging Wizard to put together the software, however when...
1
by: Larry | last post by:
Hi my friends, I created a dotnet class library and saved it at : F:\Test\c++\ex32a\debug\ex32a.dll. I created a client program to use this class library. My client file is loacated at :...
8
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
5
by: Luis Arvayo | last post by:
When I load an assembly at runtime, that is to say, a plugin DLL through Assembly.Load, an old version of the assembly is loaded. If I recompile the DLL and then copy the result to where the...
2
by: Luis Arvayo | last post by:
I am compiling and executing c# code at runtime and I need to define in CompilerParameters.ReferencedAssemblies one of my own assemblies together with the standard System.dll u others. Example:...
33
by: larpup | last post by:
I checked all my references prior to compiling. The mdb or mde works perfectly with full version of A2003. When running on a computer with RunTime i receive an error that a reference is broken...
7
ADezii
by: ADezii | last post by:
The next series of Tips will involve the Microsoft Scripting Runtime Library (Scrrun.dll). This Library is, in my humble opinion, one of the most useful and practical Libraries ever created. With the...
0
ADezii
by: ADezii | last post by:
This is the 2nd Tip in a series of Tips on the Microsoft Scripting Runtime Library. The 1st Tip related to Drives, while this Tip will concentrate on the Folders (Directories) in your PC and various...
0
ADezii
by: ADezii | last post by:
This is the 3rd in a series of Tips dealing specifically with the Microsoft Scripting Runtime Library. In this Tip, we'll show you how to return specific Properties relating to Files, as well as...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.