gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-30 00:42:43 27 4
gpt4 key购买 nike

当我将 .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)?)

提前致谢

最佳答案

托管执行过程包括以下步骤

  1. 选择编译器

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

  2. 将您的代码编译为 MSIL

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

  3. 将 MSIL 编译为 native 代码

    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.

  4. 运行代码

    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 文件时会发生什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13985530/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com