简体   繁体   中英

How to Add Reference via Developer Command Prompt

i was create a C# program in notepad and save as "Program.cs" i need compile my program in Developer Command Prompt for VS2013

but i need add Reference some dll file how to add Reference to my program in in Developer Command Prompt for VS2013

Reference this: Working with the C# 2.0 Command Line Compiler and How to: Create and Use Assemblies Using the Command Line (C# and Visual Basic)

If your client application is making use of MyCodeLibrary.dll, you need to make use of the /reference (or simply /r) option . This flag is flexible in that you may specify the full path to the *dll in question as so:

csc /t:exe /r:C:\MyCSharpCode\MyCodeLibrary\MyCodeLibrary.dll *.cs

Or, if a copy of the private assembly is in the same folder as the input files, you can simply specify the assembly name:

csc /t:exe /r:MyCodeLibrary.dll *.cs

您需要使用/r开关来添加dll引用,例如

csc /target:library /r:Assembly_Name.dll Program.cs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM