生成、打包、部署和管理应用程序及类型(1):将类型生成到模块中

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using System.Threading.Tasks;
 6 
 7 namespace Program1
 8 {
 9     class Program
10     {
11         static void Main(string[] args)
12         {
13             System.Console.WriteLine("Hi");
14         }
15     }
16 }

不要在意这就是个应用程序而已。

该应用程序定义了Program类型,其中有Main的public static方法。Main中引用了另一个System.Console。System.Console是Microsoft实现好的类型。用于实现这个类型的各个方法的IL代码存储在MSCorLib.dll中。

为了生成这个程序,请在环境变量里面配置“C:\Windows\Microsoft.NET\Framework\v4.0.30319”(csc.exe的路径),然后:

 生成Program.exe的可执行文件。Program.exe是标准PE(可移植执行体)文件。也就是说,32和64位Windows都能加载它,并通过它来执行某些操作。Windows支持三种 应用程序:控制台用户界面(/t:exe);图形用户界面(/t:winexe);Windows Store应用(/t:appcontainerexe)。

响应文件

响应文件是包含一组编译器命令行开关的文本文件。执行CSC.exe时,编译器打开响应文件,并使用其中包含的所有开关,就像是这些开关直接在命令行上传递给CSC.exe。

C#编译器支持多个响应文件。除了在命令行上显示指定的文件, 编译器还会自动查找名为CSC.rsp的文件。CSC.exe运行的时候,会在所在目录查找全局的CSC.rsp文件,想应用于自己所有项目的设置应放到其中。

# This file contains command-line options that the C#
# command line compiler (CSC) will process as part
# of every compilation, unless the "/noconfig" option
# is specified. 

# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.CSharp.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Core.dll
/r:System.Data.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Data.Linq.dll
/r:System.Data.OracleClient.dll
/r:System.Deployment.dll
/r:System.Design.dll
/r:System.DirectoryServices.dll
/r:System.dll
/r:System.Drawing.Design.dll
/r:System.Drawing.dll
/r:System.EnterpriseServices.dll
/r:System.Management.dll
/r:System.Messaging.dll
/r:System.Runtime.Remoting.dll
/r:System.Runtime.Serialization.dll
/r:System.Runtime.Serialization.Formatters.Soap.dll
/r:System.Security.dll
/r:System.ServiceModel.dll
/r:System.ServiceModel.Web.dll
/r:System.ServiceProcess.dll
/r:System.Transactions.dll
/r:System.Web.dll
/r:System.Web.Extensions.Design.dll
/r:System.Web.Extensions.dll
/r:System.Web.Mobile.dll
/r:System.Web.RegularExpressions.dll
/r:System.Web.Services.dll
/r:System.Windows.Forms.Dll
/r:System.Workflow.Activities.dll
/r:System.Workflow.ComponentModel.dll
/r:System.Workflow.Runtime.dll
/r:System.Xml.dll
/r:System.Xml.Linq.dll

  

                                               

转载于:https://www.cnblogs.com/renzhoushan/p/10355608.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值