ClrFromCSharp_2_2_生成部署打包应用程序
1,在\reps\CSharpFromCSarp\CSharpFromCSarp_2_2,建立新解决方案和解决项目
并且输入以下代码
namespace ClrFromCSharp_2_2
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("hi");
}
}
}
2,然后,在工具-命令行-Powshell,打开Powshell并且输入指令
PS C:\reps\ClrFromCSharp\ClrFromCSharp_2_2> csc.exe Program.cs
Microsoft(R) Visual C# 编译器 版本 3.4.1-beta4-19610-02 (c4e5d138)
版权所有(C) Microsoft Corporation。保留所有权利。
3,响应文件,响应文件就是包含了/r:…/t…类似的文件。以rsp结尾。默认的文件安装位置为:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
# 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
4,Program.exe文件里面到底有什么?
托管的PE文件由4个部分组成
- PE头
- CLR头
- 元数据----由二进制表构成的数据定义块,常见的有:
- 定义表
ModuleDef | 总是对模块进行标识的定义项: |
TypeDef | 模块定义的每个类型在表中的记录项 |
MethodDef | 方法的记录项 |
FieldDef | 字段的定义项 |
ParamDef | 模块定义的参数的记录项 |
PropertyDef | 属性记录项 |
EventDef | 事件定义项 |
- 引用表
- 清单表
AssemblyRef | 模块引用的每个程序集的记项 |
ModuleRef | 模块引用的每个模块的记录项 |
TypeRef | 模块引用的每个类型的记录项 |
MemberRef | 模块引用的每个成员(字段,方法,属性,事件) |
使用 ILDASM.EXE 反编译器来查看元数据表---在视图---显示---元数据。
PS C:\reps\ClrFromCSharp\ClrFromCSharp_2_2> ildasm.exe Program.exe
TypeDef #1 (02000002)
-------------------------------------------------------
TypDefName: ClrFromCSharp_2_2.Program (02000002)
Flags : [NotPublic] [AutoLayout] [Class] [AnsiClass] [BeforeFieldInit] (00100000)
Extends : 01000005 [TypeRef] System.Object
Method #1 (06000001) [ENTRYPOINT]
-------------------------------------------------------
MethodName: Main (06000001)
Flags : [Private] [Static] [HideBySig] [ReuseSlot] (00000091)
RVA : 0x00002050
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
ReturnType: Void
1 Arguments
Argument #1: SZArray String
1 Parameters
(1) ParamToken : (08000001) Name : args flags: [none] (00000000) Method #2 (06000002)
-------------------------------------------------------
MethodName: .ctor (06000002)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x0000205e
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments.
程序集---一个或多个类型定义文件或者资源文件的集合。在程序集的所有文件中有一个文件容纳了 清单(MainFest)
清单也是一个元数据表集合。CLR总是先加载清单文件,然后通过清单获取程序集中其他文件的名称
- 程序集定义可重用的类型
- 程序集有版本号标记
- 程序集可以关联安全信息
生成程序集-----以现有的PE文件作为清单的宿组,或者创建单独的PE文件,并且其中只包含清单。
清单元数据表
AssemblyDef |
如果模块标识的是程序集,则列出
|
FileDef |
作为程序集一部分的每个PE文件和资源文件在这个表中都有一个记录项。 每个记录项包含
如果只是单独的文件,则无记录 --------程序集必然包含一个主模块文件(后缀,.EXE,.DLL) |
ManifestResourceDef |
作为程序集一部分的每个资源在表中的记录项
|
ExportedTypesDef |
从程序集中所有模块导出的所有public类型在这个表中都有一个记录项
|
指定以下命令行开关,csc编译器将生成程序集:/t:exe,/t:winexe;/t:appcontainerexe;/t:library或/t:winmdobj
另外,csc还支持 /t:module开关,这个开关只是编译器生成一个不包含清单的元数据表格的PE文件。这样生成的文件是一个.dll PE文件,CLR想要访问其中的任何类型,必须先将该类型添加到一个程序集中去。使用/t:module 开关,默认扩展是.netmodule
可以使用/addmodule 将模块添加到程序集。
5,将模块合并成程序集
文件1:Ch02-3-FUT.cs
using System; public sealed class AFrequentlyUsedType {
public AFrequentlyUsedType() {
Console.WriteLine("A frequently used type was constructed.");
}
}
文件2:Ch02-3-RUT.cs
using System; public sealed class ARarelyUsedType {
public ARarelyUsedType() {
Console.WriteLine("A rarely used type was constructed.");
}
}
文件3:Ch02-3-AssemblyVersionInfo.cs//程序集版本信息
using System.Reflection; // FileDescription version information:
[assembly: AssemblyTitle("JeffTypes.dll")] // Comments version information:
[assembly: AssemblyDescription("This assembly contains Jeff's types")] // CompanyName version information:
[assembly: AssemblyCompany("Wintellect")] // ProductName version information:
[assembly: AssemblyProduct("Wintellect (R) Jeff's Type Library")] // LegalCopyright version information:
[assembly: AssemblyCopyright("Copyright (c) Wintellect 2010")] // LegalTrademarks version information:
[assembly:AssemblyTrademark("JeffTypes is a registered trademark of Wintellect")] // AssemblyVersion version information:
[assembly: AssemblyVersion("3.0.0.0")] // FILEVERSION/FileVersion version information:
[assembly: AssemblyFileVersion("1.0.0.0")] // PRODUCTVERSION/ProductVersion version information:
[assembly: AssemblyInformationalVersion("2.0.0.0")] // Set the Language field (discussed later in the "Culture" section)
[assembly:AssemblyCulture("")]
然后进行文件的生成 先进入Clr via c# 文件夹:
方法1:
csc /t:module /debug:full /out:Ch02-3-RUT.netmodule Ch02-3-RUT.cs
csc /t:library /debug:full /out:Ch02-3-MultiFileLibrary.dll /addmodule:Ch02-3-RUT.netmodule Ch02-3-FUT.cs Ch02-3-AssemblyVersionInfo.cs
方法2:需要将所有文件所有文件移动到bin\debug文件夹下,不然会找不到FUt这个文件。
csc /t:module /debug:full /out:Ch02-3-RUT.netmodule Ch02-3-RUT.cs
csc /t:module /debug:full /out:Ch02-3-FUT.netmodule Ch02-3-FUT.cs Ch02-3-AssemblyVersionInfo.cs
al /out:Ch02-3-MultiFileLibrary.dll /t:library Ch02-3-RUT.netmodule Ch02-3-FUT.netmodule
这是生成的文件:
这是 RUT的元数据
===========================================================
ScopeName : Ch02-3-RUT.netmodule
MVID : {47D0E682-537C-4CD3-94F1-74CC1A54613C}
===========================================================
Global functions
------------------------------------------------------- Global fields
------------------------------------------------------- Global MemberRefs
------------------------------------------------------- TypeDef #1 (02000002)
-------------------------------------------------------
TypDefName: ARarelyUsedType (02000002)
Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100101)
Extends : 01000001 [TypeRef] System.Object
Method #1 (06000001)
-------------------------------------------------------
MethodName: .ctor (06000001)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x00002050
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments. TypeRef #1 (01000001)
-------------------------------------------------------
Token: 0x01000001
ResolutionScope: 0x23000001
TypeRefName: System.Object
MemberRef #1 (0a000001)
-------------------------------------------------------
Member: (0a000001) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments. TypeRef #2 (01000002)
-------------------------------------------------------
Token: 0x01000002
ResolutionScope: 0x23000001
TypeRefName: System.Console
MemberRef #1 (0a000002)
-------------------------------------------------------
Member: (0a000002) WriteLine:
CallCnvntn: [DEFAULT]
ReturnType: Void
1 Arguments
Argument #1: String AssemblyRef #1 (23000001)
-------------------------------------------------------
Token: 0x23000001
Public Key or Token: b7 7a 5c 56 19 34 e0 89
Name: mscorlib
Version: 4.0.0.0
Major Version: 0x00000004
Minor Version: 0x00000000
Build Number: 0x00000000
Revision Number: 0x00000000
Locale: <null>
HashValue Blob:
Flags: [none] (00000000) User Strings
-------------------------------------------------------
70000001 : (35) L"A rarely used type was constructed." Coff symbol name overhead: 0
===========================================================
===========================================================
===========================================================
这是FUT的元数据
ScopeName : Ch02-3-FUT.netmodule
MVID : {E6088791-AAB7-4FA3-88BB-AEEB8CE9E21B}
===========================================================
Global functions
------------------------------------------------------- Global fields
------------------------------------------------------- Global MemberRefs
------------------------------------------------------- TypeDef #1 (02000002)
-------------------------------------------------------
TypDefName: AFrequentlyUsedType (02000002)
Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100101)
Extends : 0100000B [TypeRef] System.Object
Method #1 (06000001)
-------------------------------------------------------
MethodName: .ctor (06000001)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x00002050
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments. TypeRef #1 (01000001)
-------------------------------------------------------
Token: 0x01000001
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyTitleAttribute
MemberRef #1 (0a000001)
-------------------------------------------------------
Member: (0a000001) .ctor://类型有一个构造函数。
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #2 (01000002)
-------------------------------------------------------
Token: 0x01000002
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyDescriptionAttribute
MemberRef #1 (0a000002)
-------------------------------------------------------
Member: (0a000002) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #3 (01000003)
-------------------------------------------------------
Token: 0x01000003
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyCompanyAttribute
MemberRef #1 (0a000003)
-------------------------------------------------------
Member: (0a000003) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #4 (01000004)
-------------------------------------------------------
Token: 0x01000004
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyProductAttribute
MemberRef #1 (0a000004)
-------------------------------------------------------
Member: (0a000004) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #5 (01000005)
-------------------------------------------------------
Token: 0x01000005
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyCopyrightAttribute
MemberRef #1 (0a000005)
-------------------------------------------------------
Member: (0a000005) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #6 (01000006)
-------------------------------------------------------
Token: 0x01000006
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyTrademarkAttribute
MemberRef #1 (0a000006)
-------------------------------------------------------
Member: (0a000006) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #7 (01000007)
-------------------------------------------------------
Token: 0x01000007
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyVersionAttribute
MemberRef #1 (0a000007)
-------------------------------------------------------
Member: (0a000007) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #8 (01000008)
-------------------------------------------------------
Token: 0x01000008
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyFileVersionAttribute
MemberRef #1 (0a000008)
-------------------------------------------------------
Member: (0a000008) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #9 (01000009)
-------------------------------------------------------
Token: 0x01000009
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyInformationalVersionAttribute
MemberRef #1 (0a000009)
-------------------------------------------------------
Member: (0a000009) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #10 (0100000a)
-------------------------------------------------------
Token: 0x0100000a
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyCultureAttribute
MemberRef #1 (0a00000a)
-------------------------------------------------------
Member: (0a00000a) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #11 (0100000b)
-------------------------------------------------------
Token: 0x0100000b
ResolutionScope: 0x23000001
TypeRefName: System.Object
MemberRef #1 (0a00000b)
-------------------------------------------------------
Member: (0a00000b) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments. TypeRef #12 (0100000c)
-------------------------------------------------------
Token: 0x0100000c
ResolutionScope: 0x23000001
TypeRefName: System.Console
MemberRef #1 (0a00000c)
-------------------------------------------------------
Member: (0a00000c) WriteLine:
CallCnvntn: [DEFAULT]
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #13 (0100000d)
-------------------------------------------------------
Token: 0x0100000d
ResolutionScope: 0x23000001
TypeRefName: System.Runtime.CompilerServices.AssemblyAttributesGoHere
CustomAttribute #1 (0c000001)
-------------------------------------------------------
CustomAttribute Type: 0a000001
CustomAttributeName: System.Reflection.AssemblyTitleAttribute :: instance void .ctor(class System.String)
Length: 18
Value : 01 00 0d 4a 65 66 66 54 79 70 65 73 2e 64 6c 6c > JeffTypes.dll<
: 00 00 > <
ctor args: ("JeffTypes.dll")//创建了属性对象并且初始化 CustomAttribute #2 (0c000002)
-------------------------------------------------------
CustomAttribute Type: 0a000002
CustomAttributeName: System.Reflection.AssemblyDescriptionAttribute :: instance void .ctor(class System.String)
Length: 40
Value : 01 00 23 54 68 69 73 20 61 73 73 65 6d 62 6c 79 > #This assembly<
: 20 63 6f 6e 74 61 69 6e 73 20 4a 65 66 66 27 73 > contains Jeff's<
: 20 74 79 70 65 73 00 00 > types <
ctor args: ("This assembly contains Jeff's types") CustomAttribute #3 (0c000003)
-------------------------------------------------------
CustomAttribute Type: 0a000003
CustomAttributeName: System.Reflection.AssemblyCompanyAttribute :: instance void .ctor(class System.String)
Length: 15
Value : 01 00 0a 57 69 6e 74 65 6c 6c 65 63 74 00 00 > Wintellect <
ctor args: ("Wintellect") CustomAttribute #4 (0c000004)
-------------------------------------------------------
CustomAttribute Type: 0a000004
CustomAttributeName: System.Reflection.AssemblyProductAttribute :: instance void .ctor(class System.String)
Length: 39
Value : 01 00 22 57 69 6e 74 65 6c 6c 65 63 74 20 28 52 > "Wintellect (R<
: 29 20 4a 65 66 66 27 73 20 54 79 70 65 20 4c 69 >) Jeff's Type Li<
: 62 72 61 72 79 00 00 >brary <
ctor args: ("Wintellect (R) Jeff's Type Library") CustomAttribute #5 (0c000005)
-------------------------------------------------------
CustomAttribute Type: 0a000005
CustomAttributeName: System.Reflection.AssemblyCopyrightAttribute :: instance void .ctor(class System.String)
Length: 34
Value : 01 00 1d 43 6f 70 79 72 69 67 68 74 20 28 63 29 > Copyright (c)<
: 20 57 69 6e 74 65 6c 6c 65 63 74 20 32 30 31 30 > Wintellect 2010<
: 00 00 > <
ctor args: ("Copyright (c) Wintellect 2010") CustomAttribute #6 (0c000006)
-------------------------------------------------------
CustomAttribute Type: 0a000006
CustomAttributeName: System.Reflection.AssemblyTrademarkAttribute :: instance void .ctor(class System.String)
Length: 54
Value : 01 00 31 4a 65 66 66 54 79 70 65 73 20 69 73 20 > 1JeffTypes is <
: 61 20 72 65 67 69 73 74 65 72 65 64 20 74 72 61 >a registered tra<
: 64 65 6d 61 72 6b 20 6f 66 20 57 69 6e 74 65 6c >demark of Wintel<
: 6c 65 63 74 00 00 >lect <
ctor args: ("JeffTypes is a registered trademark of Wintellect") CustomAttribute #7 (0c000007)
-------------------------------------------------------
CustomAttribute Type: 0a000007
CustomAttributeName: System.Reflection.AssemblyVersionAttribute :: instance void .ctor(class System.String)
Length: 12
Value : 01 00 07 33 2e 30 2e 30 2e 30 00 00 > 3.0.0.0 <
ctor args: ("3.0.0.0") CustomAttribute #8 (0c000008)
-------------------------------------------------------
CustomAttribute Type: 0a000008
CustomAttributeName: System.Reflection.AssemblyFileVersionAttribute :: instance void .ctor(class System.String)
Length: 12
Value : 01 00 07 31 2e 30 2e 30 2e 30 00 00 > 1.0.0.0 <
ctor args: ("1.0.0.0") CustomAttribute #9 (0c000009)
-------------------------------------------------------
CustomAttribute Type: 0a000009
CustomAttributeName: System.Reflection.AssemblyInformationalVersionAttribute :: instance void .ctor(class System.String)
Length: 12
Value : 01 00 07 32 2e 30 2e 30 2e 30 00 00 > 2.0.0.0 <
ctor args: ("2.0.0.0") CustomAttribute #10 (0c00000a)
-------------------------------------------------------
CustomAttribute Type: 0a00000a
CustomAttributeName: System.Reflection.AssemblyCultureAttribute :: instance void .ctor(class System.String)
Length: 5
Value : 01 00 00 00 00 > <
ctor args: ("") AssemblyRef #1 (23000001)
-------------------------------------------------------
Token: 0x23000001
Public Key or Token: b7 7a 5c 56 19 34 e0 89
Name: mscorlib
Version: 4.0.0.0
Major Version: 0x00000004
Minor Version: 0x00000000
Build Number: 0x00000000
Revision Number: 0x00000000
Locale: <null>
HashValue Blob:
Flags: [none] (00000000) User Strings
-------------------------------------------------------
70000001 : (39) L"A frequently used type was constructed." Coff symbol name overhead: 0
===========================================================
===========================================================
===========================================================
注意其中的 属性对应的东西。 生成了属性的方法和属性的CustomAttribute。
下面是合成的Ch02-3-MultiFileLibrary.dll
的文件
===========================================================
ScopeName : Ch02-3-MultiFileLibrary.dll
MVID : {31DACE10-F746-4EA0-8641-97856BBC0726}
===========================================================
Global functions
------------------------------------------------------- Global fields
------------------------------------------------------- Global MemberRefs
------------------------------------------------------- TypeRef #1 (01000001)
-------------------------------------------------------
Token: 0x01000001
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyTitleAttribute
MemberRef #1 (0a000001)
-------------------------------------------------------
Member: (0a000001) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #2 (01000002)
-------------------------------------------------------
Token: 0x01000002
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyDescriptionAttribute
MemberRef #1 (0a000002)
-------------------------------------------------------
Member: (0a000002) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #3 (01000003)
-------------------------------------------------------
Token: 0x01000003
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyCompanyAttribute
MemberRef #1 (0a000003)
-------------------------------------------------------
Member: (0a000003) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #4 (01000004)
-------------------------------------------------------
Token: 0x01000004
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyProductAttribute
MemberRef #1 (0a000004)
-------------------------------------------------------
Member: (0a000004) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #5 (01000005)
-------------------------------------------------------
Token: 0x01000005
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyCopyrightAttribute
MemberRef #1 (0a000005)
-------------------------------------------------------
Member: (0a000005) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #6 (01000006)
-------------------------------------------------------
Token: 0x01000006
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyTrademarkAttribute
MemberRef #1 (0a000006)
-------------------------------------------------------
Member: (0a000006) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #7 (01000007)
-------------------------------------------------------
Token: 0x01000007
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyFileVersionAttribute
MemberRef #1 (0a000007)
-------------------------------------------------------
Member: (0a000007) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String TypeRef #8 (01000008)
-------------------------------------------------------
Token: 0x01000008
ResolutionScope: 0x23000001
TypeRefName: System.Reflection.AssemblyInformationalVersionAttribute
MemberRef #1 (0a000008)
-------------------------------------------------------
Member: (0a000008) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
1 Arguments
Argument #1: String Assembly//程序集信息
-------------------------------------------------------
Token: 0x20000001
Name : Ch02-3-MultiFileLibrary
Public Key :
Hash Algorithm : 0x00008004
Version: 3.0.0.0
Major Version: 0x00000003
Minor Version: 0x00000000
Build Number: 0x00000000
Revision Number: 0x00000000
Locale: <null>
Flags : [none] (00000000)
CustomAttribute #1 (0c000001)//嵌入的程序集中属性信息。
-------------------------------------------------------
CustomAttribute Type: 0a000001
CustomAttributeName: System.Reflection.AssemblyTitleAttribute :: instance void .ctor(class System.String)
Length: 18
Value : 01 00 0d 4a 65 66 66 54 79 70 65 73 2e 64 6c 6c > JeffTypes.dll<
: 00 00 > <
ctor args: ("JeffTypes.dll") CustomAttribute #2 (0c000002)
-------------------------------------------------------
CustomAttribute Type: 0a000002
CustomAttributeName: System.Reflection.AssemblyDescriptionAttribute :: instance void .ctor(class System.String)
Length: 40
Value : 01 00 23 54 68 69 73 20 61 73 73 65 6d 62 6c 79 > #This assembly<
: 20 63 6f 6e 74 61 69 6e 73 20 4a 65 66 66 27 73 > contains Jeff's<
: 20 74 79 70 65 73 00 00 > types <
ctor args: ("This assembly contains Jeff's types") CustomAttribute #3 (0c000003)
-------------------------------------------------------
CustomAttribute Type: 0a000003
CustomAttributeName: System.Reflection.AssemblyCompanyAttribute :: instance void .ctor(class System.String)
Length: 15
Value : 01 00 0a 57 69 6e 74 65 6c 6c 65 63 74 00 00 > Wintellect <
ctor args: ("Wintellect") CustomAttribute #4 (0c000004)
-------------------------------------------------------
CustomAttribute Type: 0a000004
CustomAttributeName: System.Reflection.AssemblyProductAttribute :: instance void .ctor(class System.String)
Length: 39
Value : 01 00 22 57 69 6e 74 65 6c 6c 65 63 74 20 28 52 > "Wintellect (R<
: 29 20 4a 65 66 66 27 73 20 54 79 70 65 20 4c 69 >) Jeff's Type Li<
: 62 72 61 72 79 00 00 >brary <
ctor args: ("Wintellect (R) Jeff's Type Library") CustomAttribute #5 (0c000005)
-------------------------------------------------------
CustomAttribute Type: 0a000005
CustomAttributeName: System.Reflection.AssemblyCopyrightAttribute :: instance void .ctor(class System.String)
Length: 34
Value : 01 00 1d 43 6f 70 79 72 69 67 68 74 20 28 63 29 > Copyright (c)<
: 20 57 69 6e 74 65 6c 6c 65 63 74 20 32 30 31 30 > Wintellect 2010<
: 00 00 > <
ctor args: ("Copyright (c) Wintellect 2010") CustomAttribute #6 (0c000006)
-------------------------------------------------------
CustomAttribute Type: 0a000006
CustomAttributeName: System.Reflection.AssemblyTrademarkAttribute :: instance void .ctor(class System.String)
Length: 54
Value : 01 00 31 4a 65 66 66 54 79 70 65 73 20 69 73 20 > 1JeffTypes is <
: 61 20 72 65 67 69 73 74 65 72 65 64 20 74 72 61 >a registered tra<
: 64 65 6d 61 72 6b 20 6f 66 20 57 69 6e 74 65 6c >demark of Wintel<
: 6c 65 63 74 00 00 >lect <
ctor args: ("JeffTypes is a registered trademark of Wintellect") CustomAttribute #7 (0c000007)
-------------------------------------------------------
CustomAttribute Type: 0a000007
CustomAttributeName: System.Reflection.AssemblyFileVersionAttribute :: instance void .ctor(class System.String)
Length: 12
Value : 01 00 07 31 2e 30 2e 30 2e 30 00 00 > 1.0.0.0 <
ctor args: ("1.0.0.0") CustomAttribute #8 (0c000008)
-------------------------------------------------------
CustomAttribute Type: 0a000008
CustomAttributeName: System.Reflection.AssemblyInformationalVersionAttribute :: instance void .ctor(class System.String)
Length: 12
Value : 01 00 07 32 2e 30 2e 30 2e 30 00 00 > 2.0.0.0 <
ctor args: ("2.0.0.0") AssemblyRef #1 (23000001)//相关程序集
-------------------------------------------------------
Token: 0x23000001
Public Key or Token: b7 7a 5c 56 19 34 e0 89
Name: mscorlib
Version: 4.0.0.0
Major Version: 0x00000004
Minor Version: 0x00000000
Build Number: 0x00000000
Revision Number: 0x00000000
Locale: <null>
HashValue Blob:
Flags: [none] (00000000) File #1 (26000001)//相关文件
-------------------------------------------------------
Token: 0x26000001
Name : Ch02-3-RUT.netmodule
HashValue Blob : 5b fa 12 3e a9 d0 b0 da fa 38 30 e9 ca 49 21 c0 1b c1 bc bb
Flags : [ContainsMetaData] (00000000) File #2 (26000002)
-------------------------------------------------------
Token: 0x26000002
Name : Ch02-3-FUT.netmodule
HashValue Blob : 72 3c cc 7d 75 d1 0a 78 df 09 a3 a8 71 3a e9 68 fe bb 0b 5e
Flags : [ContainsMetaData] (00000000) ExportedType #1 (27000001)//输出的类型
-------------------------------------------------------
Token: 0x27000001
Name: ARarelyUsedType
Implementation token: 0x26000001
TypeDef token: 0x02000002
Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100101) ExportedType #2 (27000002)
-------------------------------------------------------
Token: 0x27000002
Name: AFrequentlyUsedType
Implementation token: 0x26000002
TypeDef token: 0x02000002
Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100101) User Strings
-------------------------------------------------------
70000001 : ( 1) L" " Coff symbol name overhead: 0
===========================================================
===========================================================
===========================================================
6,在VS中引用程序集
想引用程序集中的解决方案,可以右击项目,然后在引用里面添加
- 程序集:添加程序集
- 项目:解决方案,在同一个解决方案的一个项目引用不同项目的方法
- COM:允许托管代码访问非托管的COM对象
- 浏览:自定义插入程序集。
7,为程序集添加资源文件:
AL.EXE支持嵌入资源文件---/embed[resource] /link[resource]
csc.exe 支持嵌入资源文件---/resource ---linkresource
8,程序集信息
1,程序集信息输入方式:
- 在项目上属性,程序集里面可以看到信息
- 我的git地址-----CLR from c# 配套编程文件:在VS中下载即可。
- 我的git教程----查看我之前的git博文
using System.Reflection; // FileDescription version information:
[assembly: AssemblyTitle("JeffTypes.dll")] // Comments version information:
[assembly: AssemblyDescription("This assembly contains Jeff's types")] // CompanyName version information:
[assembly: AssemblyCompany("Wintellect")] // ProductName version information:
[assembly: AssemblyProduct("Wintellect (R) Jeff's Type Library")] // LegalCopyright version information:
[assembly: AssemblyCopyright("Copyright (c) Wintellect 2010")] // LegalTrademarks version information:
[assembly:AssemblyTrademark("JeffTypes is a registered trademark of Wintellect")] // AssemblyVersion version information:
[assembly: AssemblyVersion("3.0.0.0")] // FILEVERSION/FileVersion version information:
[assembly: AssemblyFileVersion("1.0.0.0")] // PRODUCTVERSION/ProductVersion version information:
[assembly: AssemblyInformationalVersion("2.0.0.0")] // Set the Language field (discussed later in the "Culture" section)
[assembly:AssemblyCulture("")]
ClrFromCSharp_2_2_生成部署打包应用程序的更多相关文章
- InstallShield Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序)
InstallShield Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序) 标签: InstallShieldVS2013 2015 ...
- vs2010打包winform程序详解
vs2010打包winform程序详解 最近一直在做winform程序,做完后程序打包很头疼,第三方打包工具,好用的花钱,不花钱的不好用,最后只能用vs自带的打包工具了! 打包过程vs2010(包 ...
- Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序)
原文:InstallShield Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序) InstallShield Limited Edi ...
- 如何:使用 Visual Studio 中的一键式发布来部署 Web 应用程序项目
原文: 如何:使用 Visual Studio 中的一键式发布来部署 Web 应用程序项目 本主题介绍如何在以下产品中使用 一键式发布 发布(部署)Web 应用程序项目: Visual Studio ...
- C#打包应用程序
摘要:本文介绍在C#中手把手教你用C#打包应用程序(安装程序卸载程序) 1:新建安装部署项目 打开VS,点击新建项目,选择:其他项目类型->安装与部署->安装向导(安装项目也一样),然后点 ...
- 为通过ClickOnce部署的应用程序进行数字签名
为通过ClickOnce部署的应用程序进行数字签名 ClickOnce是.NET用于Windows应用程序的一种便捷部署方式.不过由于便捷,导致缺少自定义操作的空间.比如需要对通过ClickOnce部 ...
- Prism 4 文档 ---第11章 部署Prism应用程序
要成功移动Prism应用到生产中,需要对部署计划为应用程序的设计过程的一部分.本章介绍了注意事项和你需要采取的准备以部署应用程序,以及你要在用户手中获得部署程序所需要采取的行动. Si ...
- C#:手把手教你用C#打包应用程序(安装程序卸载程序)
摘要:本文介绍在C#中手把手教你用C#打包应用程序(安装程序卸载程序) 1:新建安装部署项目 打开VS,点击新建项目,选择:其他项目类型->安装与部署->安装向导(安装项目也一样),然后点 ...
- 关于在windows下部署发布QT程序的总结
原文请看:http://www.cnblogs.com/javaexam2/archive/2011/05/18/2632916.html 关于在windows下部署发布QT程序的总结 2008-06 ...
随机推荐
- .net core3.1 下由Autofac接管IOC
我们都知道,.net core天生自带IOC容器,但是他的功能其实并不强大,而且有坑:在构造注入的时候,他默认找参数最少的构造函数. 这里,我讲解如何使用Autofac去接管IOC,至于为什么要选Au ...
- 娱乐往事,年初捡到1G PAR,平淡的日子泛起波澜
常听说这样的故事 垃圾佬捡到蓝牙键盘,于是配了一台上万的电脑 垃圾佬捡到机箱,于是配了一台带遥控的HTPC 垃圾佬捡到假NAS,于是组了20+T的RAID 而我,不是垃圾佬,更没有捡到过U盘,对突如其 ...
- SpringMVC基础(一)_控制器
Spring MVC Spring MVC 基于模型-视图-控制器(Model-View-Controller)模式实现,它能够帮你构建灵活和松耦合的应用程序. 1.Spring MVC的请求追踪 每 ...
- ubuntu 如何添加alias
公司的nx 上面一般使用gvim 编辑文件.并且为gvim 增加了alias,只要敲 g 就是gvim 的意思,这样编辑一个文件只需要 g xxx.v 就可以了.非常方便. 在自己电脑上安装了ubun ...
- 2019ccpc哈尔滨打铜记
小学生日记: 2019.10.13,哈尔滨,打了个铜 开头 先说结论,这次失败,我的锅70%,sdl的锅5%,ykh25% Day0 周五, 我们队出现了奇怪的厄运上身 首先是我中途在飞机上数据线突然 ...
- 《Python学习手册 第五版》 -第6章 动态类型
本章主要讲述变量.对象.引用三者直接的关联及区别,详细说明了在变量赋值的操作中,计算机内部到底发生了什么,有哪些是不被人察觉和需要明确了解的 1.先从最简单的赋值语句开始 a=3 这一句,基本就能涵盖 ...
- bootstrap 按钮组件
按钮组件主要的类名: .btn-toolbar 把几个 .btn-group 组合在一起,更复杂的组件 .btn-group .btn-group-vertical 垂直堆叠显示 ...
- [1天搞懂深度学习] 读书笔记 lecture I:Introduction of deep learning
- 通常机器学习,目的是,找到一个函数,针对任何输入:语音,图片,文字,都能够自动输出正确的结果. - 而我们可以弄一个函数集合,这个集合针对同一个猫的图片的输入,可能有多种输出,比如猫,狗,猴子等, ...
- ELK(V7)部署与架构分析
1.ELK的背景介绍与应用场景 在项目应用运行的过程中,往往会产生大量的日志,我们往往需要根据日志来定位分析我们的服务器项目运行情况与BUG产生位置.一般情况下直接在日志文件中tailf. grep. ...
- 吐槽一下python
关于python,优点有很多.例如,编码灵活,书写随意. 印象最深的就是,Duck Type.也就说,如果使用会走路和会飞来衡量鸭子, 那么如果一个物体,走路像鸭子,飞起来像鸭子,那么它就是鸭子. d ...