How to use references when compiling c# code via command line

前端 未结 1 1041
梦毁少年i
梦毁少年i 2020-12-17 04:05

Could anyone help me compile via command line some c# files? I have 4 files to compile, Main, Form1 (which uses 2.cs file) and another class used in the project.

I

相关标签:
1条回答
  • 2020-12-17 04:24

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

    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. Short version of documentation available directly from command line by specifying /?: C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc /?

    0 讨论(0)
提交回复
热议问题