Quick question. I have a cs file obviously and I am attempting to create the dll via cmd. When I tr I get an CS0246 error saying that a namespace could not be found. How do I put the assembly reference with the file so that I do not get this error. I am thinking that I need to put the assemblies within the same area that my cs file is. Am going to try this and will post if that was the problem. In the meantime any suggestions are welcome. I do not want to do this in visual studio, so please do not suggest that.
add the /r
argument (short for /reference). Keep in mind that a type can live the namespace A.B.C but that doesn't mean that type is included in the Assembly A.B.C. One assembly can have an arbritary number of namespaces with types in it.
csc /t:library /t:library /lib:"C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0" /r:System.Data.dll /r:System.Activities.dll /r:System.Management.Automation.dll CopyFile.cs
If your referenced assemblies are in a different folder you can add the /lib
argument to specify probing folders.