简体   繁体   English

如何通过开发人员命令提示符添加参考

[英]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 我在记事本中创建了一个C#程序,并另存为“ Program.cs”,我需要在VS2013的“开发人员命令提示符”中编译我的程序

but i need add Reference some dll file how to add Reference to my program in in Developer Command Prompt for VS2013 但是我需要添加引用一些dll文件,如何在VS2013的Developer Command Prompt中添加对我的程序的引用

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) 参考以下内容: 使用C#2.0命令行编译器以及如何:使用命令行创建和使用程序集(C#和Visual Basic)

If your client application is making use of MyCodeLibrary.dll, you need to make use of the /reference (or simply /r) option . 如果您的客户端应用程序正在使用MyCodeLibrary.dll,则需要使用/reference (or simply /r) option This flag is flexible in that you may specify the full path to the *dll in question as so: 该标志很灵活,因为您可以这样指定所讨论的* dll的完整路径:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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