473,952 Members | 13,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_PAT H" in UNIX?

Jun 26 '07 #1
2 2816
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******** *************@a 26g2000pre.goog legroups.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_PAT H" in UNIX?

Jun 26 '07 #2
Hi,

"sealo" <se*****@gmail. comwrote in message
news:11******** *************@a 26g2000pre.goog legroups.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
7531
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 I try to load it on one of the computers in our office it has an error. "ERROR 75 Path/File access error. An unexpected Setup error has occurred." I do not know what is causing it or how to fix it. Any help would be greatly appreciated. ...
1
3578
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 : F:\Test\c++\ex32b\debug\ex32b.exe.
8
34717
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 web apps? Any help is greatly appreciated. Thanks,
5
1858
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 assembly is loaded by the main app, anyway, the old assembly is used. From where ?, I don't know. I don't have an error here. Checked several times, because if I delete the assembly, at runtime it is not detected by the Directory.GetFiles() method. It...
2
10975
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: // compiler options System.CodeDom.Compiler.CompilerParameters options = new System.CodeDom.Compiler.CompilerParameters(); options.GenerateExecutable = false; // result is a dll
33
7427
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 to msoutl.olb version 9.2. Can anyone shed some light on this as I need to deploy this application as soon as possible. Any information regarding this would be greatly appreciated.
7
8885
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 Scripting Runtime Library, you can retrieve information related to Drives, Folders, Files, and Text Files and set/retrieve certain Attributes of Drives, Folders, Files, and Text Files. Through Methods exposed by this Library, you can also manipulate...
0
5168
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 methods to retrieve information from and how to manipulate them. The code should be self explanatory and basically documents itself. Should there be any questions related to this Topic, please feel free to ask. 'Accessing Folder Properties Dim...
0
5429
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 various Methods to Copy, Move, and Delete them. The code is self explanatory, so I'll jump right in: Dim fso As FileSystemObject, fil As File 'Set fso = New Scripting.FileSystemObject OR Set fso = CreateObject("Scripting.FileSystemObject") ...
0
10004
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11616
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11385
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10710
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8292
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7454
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4973
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.