I created a C# file and wish to compile it into a DLL for future use. However, this .cs file depends on another DLL. In my code inside my .cs file I am doing something like:
using anotherlib.dll;
When I try to compile it into a DLL, the compiler tells me that it can't find that anotherlib.dll (missing directive or assembly reference).
What is the right way to go about it?
I am using .NET 2.0.
You need to add a reference to that particular DLL.
If you are using Visual Studio try the following
using
statement to the desired namespaceIf you have the source for the DLL, it's much better to use a project reference than a file reference. Simply add the project to the same solution, repeat steps 1-2 above and select Projects instead of Browse.
If you are not using Visual Studio, then you need to pass the fully qualified path of the DLL to the compiler with the /r: flag.