Click here to Skip to main content
15,894,825 members
Home / Discussions / C#
   

C#

 
GeneralRe: Microphone Input Level Indicator Pin
GTWebb2-Jan-05 12:04
GTWebb2-Jan-05 12:04 
GeneralCardinal Splines Pin
thepersonof30-Dec-04 23:59
thepersonof30-Dec-04 23:59 
GeneralRe: Cardinal Splines Pin
Heath Stewart31-Dec-04 7:59
protectorHeath Stewart31-Dec-04 7:59 
Generalload data's from a xml file into a dataset for a single field alone Pin
dhol30-Dec-04 23:59
dhol30-Dec-04 23:59 
GeneralRe: load data's from a xml file into a dataset for a single field alone Pin
Heath Stewart31-Dec-04 6:52
protectorHeath Stewart31-Dec-04 6:52 
GeneralRe: load data's from a xml file into a dataset for a single field alone Pin
dhol31-Dec-04 16:58
dhol31-Dec-04 16:58 
GeneralAdding dll to the workspace Pin
Md Saleem Navalur30-Dec-04 23:21
Md Saleem Navalur30-Dec-04 23:21 
GeneralRe: Adding dll to the workspace Pin
Heath Stewart31-Dec-04 6:38
protectorHeath Stewart31-Dec-04 6:38 
First of all there's no such thing as a C# DLL or C# exe. The Common Language Infrastructure (CLI) of which the .NET Framework is Microsoft's implementation (Mono and Portable.NET are alternative CLI implementations) describes that managed languages are compiled to Intermediate Language, or IL. That's not to say the result from equivalent code in different languages is the same, but close (compilers perform optimizations and may include other features that other compilers don't have).

That being said, when working on a multi-project solution it's best if you use project references instead of assembly references. This creates project dependencies, so that changes in a dependent project will make sure it gets compiled first before compiling the target project. It also makes sure that your target project is up-to-date with the latest version of the assembly.

There are only three options for dependent assemblies: copy the assembly to the local obj and bin directories, install the assembly into the GAC, or use a runtime configuration file.

The first - copying the assembly locally - is best for development. You will undoubtably be changing your project often and the CLR needs to resolve your assembly. It will use the current directory, then a configuration file, then check the GAC (Global Assembly Cache). It does not use the PATH environment variables like native appliation loaders do, but you can set a separate DEVPATH for developmental purposes, but this is not recommended.

Installing the assembly into the GAC is only recommended for released assemblies, like third-party libraries you use or your own in-house libraries that have been released internally. For projects that change often this gets to be a real hastle and you need to reference the assembly to build anyway. The GAC is only used at runtime and referencing a GAC-only assembly (i.e., there's no assembly in a version directory, like there is in the %WINDIR%\Microsoft.NET\Framework\<Version> directory) in difficult because you can't use Windows Explorer (so not the Open or Save dialogs, either, so that you could browse for the assembly).

The third option requires that you update your configuration file and know about publisher policies, version redirection, codebase changes, etc. It's not worth it.

Note that "Copy Local" is for runtime purposes, as is everything about. The path of the assembly that you're referencing is still used to build against. If "Copy Local" is set to true, then the assembly is first copied but this is primarily for runtime. If the CLR can't resolve your dependent assembly an exception will be thrown and your application will not run.

For more information about how the CLR ("Runtime") resolves assemblies, read How the Runtime Locates Assemblies[^].

To learn about publisher policies and other runtime configuration settings, start by reading Redirecting Assembly Versions[^] along with the next few topics after it, including Specifying an Assembly's Location[^].

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: Adding dll to the workspace Pin
Md Saleem Navalur31-Dec-04 21:29
Md Saleem Navalur31-Dec-04 21:29 
GeneralRe: Adding dll to the workspace Pin
Heath Stewart31-Dec-04 22:49
protectorHeath Stewart31-Dec-04 22:49 
Questionhow to lock a method in class Pin
ting66830-Dec-04 22:11
ting66830-Dec-04 22:11 
AnswerRe: how to lock a method in class Pin
Robert Rohde30-Dec-04 22:19
Robert Rohde30-Dec-04 22:19 
AnswerRe: how to lock a method in class Pin
Heath Stewart31-Dec-04 6:26
protectorHeath Stewart31-Dec-04 6:26 
GeneralRe: how to lock a method in class Pin
ting6682-Jan-05 15:13
ting6682-Jan-05 15:13 
GeneralRe: how to lock a method in class Pin
Heath Stewart2-Jan-05 21:18
protectorHeath Stewart2-Jan-05 21:18 
GeneralRe: how to lock a method in class Pin
ting6683-Jan-05 14:49
ting6683-Jan-05 14:49 
GeneralRe: how to lock a method in class Pin
Heath Stewart3-Jan-05 18:47
protectorHeath Stewart3-Jan-05 18:47 
QuestionIs this kind of encapsulation right for the event and delegate? Pin
Salil Khedkar30-Dec-04 20:00
Salil Khedkar30-Dec-04 20:00 
AnswerRe: Is this kind of encapsulation right for the event and delegate? Pin
Heath Stewart30-Dec-04 20:29
protectorHeath Stewart30-Dec-04 20:29 
GeneralRe: Is this kind of encapsulation right for the event and delegate? Pin
Salil Khedkar2-Jan-05 21:26
Salil Khedkar2-Jan-05 21:26 
Generalload values into the dataset form the xml Pin
dhol30-Dec-04 19:11
dhol30-Dec-04 19:11 
GeneralProgrammetically Selection of Language Pin
SoloVision30-Dec-04 18:22
SoloVision30-Dec-04 18:22 
GeneralRe: Programmetically Selection of Language Pin
Heath Stewart30-Dec-04 20:14
protectorHeath Stewart30-Dec-04 20:14 
Generalprogramticly scroll a richtextbox Pin
Tyrus18230-Dec-04 14:46
Tyrus18230-Dec-04 14:46 
GeneralRe: programticly scroll a richtextbox Pin
Heath Stewart30-Dec-04 20:06
protectorHeath Stewart30-Dec-04 20:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.