Relation between DLLs and Namespaces in C#
.net, c#, dll
Solution
In C#, DLLs (aka assemblies) contain `class`es (and other types). These types typically have long full names, like `System.Collections.Generic.List<T>`. These types can contain methods.
In your `References` area, you have references to assemblies (this is part of your .csproj file). In a .cs file, you don't need to include any `using` to reference this DLL, because it's already referenced in your .csproj file.
If you include a line like `using System.Collections.Generic;`, that tells the C# compiler to look for `System.Collections.Generic.List<T>` when you type `List<T>`. You don't need to do it that way, however: you can simply type `System.Collections.Generic.List<T>`.
Problem
High-level question here: I have spent a lot of time today educating myself on basic high-level concepts such as APIs, static and dynamic libraries, DLLs and marshaling in C#. Gaining all of this knowledge led me to what seems like a pretty basic question, and probably demonstrates a hole in my understanding of these concepts: What I know: - DLLs may contain classes which in turn contains various class-members such as methods and fields, several of which I might want to utilize in my program - In C# we use the keyword "using" at the top of the code, to define a namespace we want to include in our program What I do not get: I was under the impression that the actual methods were defined in the DLLs. How does my program find the actual functions that are defined in the DLLs, when all i give them is a namespace? It seems more intuitive to me to have "using XYZ.dll" at top, rather than "using XYZ_namespace". Thanks a lot for helping me fill in the gaps here. EDIT: Modified post to be specific to C#. EDIT 2: For other people that wonder how their C# application actually gets a hold of the types made available through "using namespaceX", this is a good resource (in addition to the helpful posts below): http://broadcast.oreilly.com/2010/07/understanding-c-namespaces-and.html. Basically the type you would like to use resides in libraries and you have to set Visual Studio to reference these libraries in order to make it possible to "use" its namespace in your code.