继续补充点吧。接上一篇,我们实现了.net framework的精简的步骤。

有网友评论了,那个核心的 mscoree.dll

从.net framework 2.0开始,微软开始了新的CLR承载模型。程序域模型。

参考文档:

https://msdn.microsoft.com/en-us/library/9x0wh2z3(v=vs.90).aspx

Hosting the Common Language Runtime

.NET Framework 3.5

For applications that were written by using the .NET Framework, hosting the common language runtime is completely transparent. If you compile your managed code as an .exe assembly, the runtime is started automatically by mscoree.dll when the .exe is run. However, unmanaged applications can also benefit from hosting the common language runtime. The runtime provides a framework for extending applications such as Microsoft Internet Information Services and Microsoft SQL Server 2005.

Whether it is invoked automatically, as with managed .exe assemblies, or loaded by using the unmanaged hosting API, a .NET Framework application requires a piece of code called a runtime host. The runtime host loads the runtime into a process, creates application domains within the process, and loads and executes user code within those application domains.

exe 的执行入口,就是那个mscoree.dll 。

所以 一旦在注册表 +系统目录中注册了这个Dll 那么托管语言的程序就能被加载执行。

This documentation is archived and is not being maintained.
Recommended Version

Runtime Hosts

.NET Framework 3.5

The common language runtime has been designed to support a variety of different types of applications, from Web server applications to applications with a traditional rich Windows user interface. Each type of application requires a runtime host to start it. The runtime host loads the runtime into a process, creates the application domains within the process, and loads user code into the application domains.

从这段文字就看出来,虚机程序的奥妙所在。所有的虚机程序,都由运行时承载。

Loading the Common Language Runtime into a Process

.NET Framework 3.5

Before any managed code can be executed, the host must load and initialize the common language runtime. All hosts start with an unmanaged stub because the runtime is not yet running in the process. The .NET Framework provides a set of unmanaged APIs called the hosting APIs that the host can use to start the runtime. For more information, see Hosting Interfaces.

To load the runtime into a process, a host calls the CorBindToRuntimeEx Function function. The prototype for CorBindToRuntimeEx Function is located in Mscoree.h in the Include directory of the Windows Software Development Kit (SDK). The host uses CorBindToRuntimeEx Function to control which version of the runtime to load and the behavior of basic functions such as garbage collection and assembly loading. A host can set the values listed in the following table.

上述文字来自MSDN :https://msdn.microsoft.com/en-us/library/01918c6x(v=vs.90).aspx

托段代码加载执行前,需要开辟一个指定的进程进行承载。如何去开启运行时承载进行?.net 提供了一系列的非托管接口API,由这些API去开启承载进程。然后展开一系列的动作。

好了,看到这里,也基本能看出个大概了。

有网友希望提供精简版的安装包,期望各位能自己动手去完成。

转载于:https://www.cnblogs.com/micro-chen/p/6398523.html

【.Net Framework 体积大?】不安装.net framework 也能运行!?原理补充-3相关推荐

  1. 【.Net Framework 体积大?】不安装.net framework 也能运行!?开篇叙述-1

    [声明:请尊重作者micro-chen的原创,抓文章,请添加来源和作者署名.作者保留追责权利.......] 注释:笔者只想通过抛砖引玉的方式,引导大家自己去实行,去探索,毕竟,微软的版本问题也不好说 ...

  2. Windows系统常用运行库安装包(C++及.NET Framework),以及安装.NET Framework时提示证书不受信任的解决方案

    C++运行库 https://download.csdn.net/download/bwkair/81269950 .NET Framework 4.8 (兼容4.7.2及其以下版本) https:/ ...

  3. 大数据技术,Spark核心技术之运行原理

    在大数据领域,只有深挖数据科学领域,走在学术前沿,才能在底层算法和模型方面走在前面,从而占据领先地位. Spark的这种学术基因,使得它从一开始就在大数据领域建立了一定优势.无论是性能,还是方案的统一 ...

  4. vs2005制作安装包(自动安装.net framework 2.0)(小寿原创)

    vs2005制作安装包(自动安装.net framework 2.0)(小寿原创) 新建项目-> 其他项目类型->安装和部署->安装向导! 安装向导会提示你添加要安装的文件,这时你可 ...

  5. NSIS:判断并安装.NET Framework的例子(转载)

    NSIS:判断并安装.NET Framework的例子 现在.NET开发的软件已经大行其道,但有些操作系统并不符合软件的运行要求,所以,我们需要在安装程序中进行.NET Framework的判断,如果 ...

  6. 错误代码0x800f0950怎么解决_解决win10安装net framework 3.5失败(错误代码 0x800F0950)...

    视频教程: Win10教程 安装net framework 3.5失败(错误代码 0x800F0950)_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili​www.bilibili.com 一:出现 ...

  7. NSIS:判断并安装.NET Framework 4 的例子

    NSIS:判断并安装.NET Framework 4 的例子 原文 NSIS:判断并安装.NET Framework 4 的例子 现在.NET开发的软件已经大行其道,但有些操作系统并不符合软件的运行要 ...

  8. 【已解决】win10离线安装.net framework 3.5(错误:0x8024402c)

    首先说一下问题的背景,PC是离线环境win10系统,主要在在离线安装VS2008的时候需要先安装这个低版本.Net 网上有很多方式,这次参考价值最大的是这两个 Win10离线安装.net framew ...

  9. 用 .Net Framework 4.0 制作的安装程序来安装 .Net Framework 4.0 编写的程序

    文章题目看起来有点绕,解释一下,假如你基于框架写了一个程序,想装到客户机上,但是客户机上可能并没有安装框架,因此你的程序需要预先将框架安装在目标机上,然后再执行一些安装程序的标准功能,如创建快捷方式. ...

  10. 解决win10安装net framework 3.5失败问题(附带sxs文件下载)

    win10安装net framework 3.5失败原因无非程序功能开启失败,解决办法如下: 一.从win10安装包目录中拷贝sxs文件到E盘根目录下. (1)win10下载参考地址:https:// ...

最新文章

  1. Python学习 - 之 数据封装和私有属性
  2. php常量数组吗,包含数组的PHP常量?
  3. 修改类名后依旧按照原先的类名进行加载
  4. memcached内存管理及key value长度限制
  5. Python: 如何继承str/string?
  6. app能不能跳转外部h5_利用条件编译在app端使用h5+(网页跳转 实例)
  7. mysql 索引列为Null的走不走索引及null在统计时的问题
  8. 作业4 猜数字游戏jsp
  9. 恒生电子:收购Summit中国区业务
  10. Django model字段类型
  11. STM32程序的烧录方式 与 ISP一键下载
  12. 阿铭Linux_网站维护学习笔记20190410
  13. C盘清理方法汇总:SpaceSniffer与Windows.edb
  14. 未来软件是什么样子?
  15. android nmea 工具,android – 如何从nmea句子信息计算以米为单位的gps准确度
  16. 小米手机全球已舍弃“MI”品牌,全面改用“xiaomi”全称品牌
  17. 意大利语合同翻译多少钱
  18. MIUI黑科技之小米直达服务:Web 般的流畅体验+更少的卡顿、延迟
  19. 计算机毕业设计-基于springboot的会员积分管理系统-会员等级管理系统java代码
  20. 蓝桥杯 试题 B 既约分数

热门文章

  1. html标题用什么字母,HTML标题有什么作用?
  2. 类成员函数可以返回该类的实例吗_关于类的理解
  3. android tabhost 跳转,TabHost中跳转到指定Tab页问题
  4. xshell linux查看cpu,Linux系统CPU子系统,命令和监控
  5. Centos7 firewall防火墙常用配置
  6. Doing It in User Space
  7. 解决企业IT三大运维管理难题
  8. 09月23日 pytorch与resnet(一)
  9. 整理转载:分枝定界图解(含 Real-Time Loop Closure in 2D LIDAR SLAM论文部分解读及BB代码部分解读)
  10. Redis12-事件