How to use links when compiling C # code via command line

Can someone help me compile some C # files through the command line? I have 4 files to compile: Main, Form1 (which uses the 2.cs file) and another class used in the project.

I would like to compile this project on the command line to add / t: library switch (as in this lesson: http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx ).

However, after using "csc / t: library Program1.cs MainForm.cs MainForm.Designer.cs EigenObjectRecognizer.cs" I get missing assembly build errors, such as:

\Project\FaceRecProOVaspVer\FaceRecProOV\MainForm.cs(14,15): error CS0234: The type or namespace name 'Structure' does not exist
    in the namespace 'Emgu.CV' (are you missing an assembly reference?)

I have installed EMGU executables installed. I think I need to use some .dll from this folder, such as EMGU.CV.dll?

+5
source share
1 answer

To reference the library on the command line, you need to use the /r:compiler option and pass the relative path to the library. Assuming you can do the following in the same directory

csc / r: EMGU.CV.dll / t: library Program1.cs MainForm.cs MainForm.Designer.cs EigenObjectRecognizer.cs

Documentation: http://msdn.microsoft.com/en-us/library/yabyz3h4 . A short version of the documentation is available directly from the command line, specifying /?:C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc /?

+11
source

All Articles