In visual studio, I can click on "Reference" > "Add reference" and browse to an existing .dll file from my computer. I can then use the referenced dll as follows:
dllNameSpace.dllClassName myReference = new dllNameSpace.dllClassName();
myReference.someVoid();
I know how to add a referenced assembly using codedom (will show this below), but the actual dll file is not being added to the project as it is when done through Visual Studio. Again, I need to be able to call some function in the dll file I'd like to reference.
What I'm doing now:
// Configure a CompilerParameters that links the system.dll and produces the specified executable file.
string[] referenceAssemblies = {
"System.dll",
"System.Drawing.dll",
"System.Windows.Forms.dll",
"System.Data.dll",
"System.Xml.dll",
"System.Management.dll",
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\myDllFile.dll"
};
CompilerParameters cp = new CompilerParameters(referenceAssemblies, exeFile, false);
I'm assuming that I will need to do something different in order to have CodeDom add the dll to the output executable file. What more needs to be done here?
Thanks for the help everyone!