I\'m new to C# and I\'m trying to learn to usage of DLLs. I\'m trying to wrap my objects in a DLL, and then use it in my program.
public class Foo // its in
I am late to the party here but am leaving this answer for someone pulling his/her hair out like me. So basically, I did not have the luxury of VS IDE when facing this issue.I was trying to compile the code via cmdline using csc. In order to reference a dll, just add the compiler flag /r:PathToDll/NameOfTheDll to csc.
The command would look like
csc /r:PathToDll/NameOfTheDll /out:OutputExeName FileWhichIsReferencingTheDll.cs
In FileWhichIsReferencingTheDll.cs add using namespace AppropriateNameSpace;
to access the functions (by calling class.functionName if static or by creating an object of the class and invoking the function on the object).