c# – 当我将源代码编译到.net框架中的exe文件时会发生什么

将.NET源代码(c#或vb)编译为.exe文件时会发生什么?我希望了解在制作exe文件时发生的过程,并查看了有关逆向工程和反编译的几个问题(例如,How do I decompile a .NET EXE into readable C# source code?What happens when user click .NET assembly (EXE)?)

提前致谢

最佳答案
托管执行过程包括以下步骤

>选择编译器

To obtain the benefits provided by the common language runtime, you must use one or more language compilers that
target the runtime.

>将代码编译为MSIL

Compiling translates
your source code into Microsoft intermediate language (MSIL) and
generates the required metadata.

>将MSIL编译为本机代码

At execution time, a just-in-time (JIT) compiler translates the MSIL into
native code. During this compilation, code must pass a verification
process that examines the MSIL and metadata to find out whether the
code can be determined to be type safe.

>运行代码

The common language runtime provides the infrastructure that enables execution to
take place and services that can be used during execution.

在这里查看详细信息:http://msdn.microsoft.com/en-us/library/k5532s8a.aspx

转载注明原文:c# – 当我将源代码编译到.net框架中的exe文件时会发生什么 - 代码日志