我们为什么以及在哪里需要托管模块

时间:2022-09-01 14:26:57

I know that Managed Modules are logical code containers containing PE32 Header, CLR Header, Metadata and IL code. And assemblies can contain multiple managed modules linked using Assembly Linker (AI.exe). But VS doesn't support multiple managed module assemblies. I am wondering when and why an where we do need Managed Modules if we cannot use them without assemblies etc. Couldn't we just use assemblies?

我知道Managed Modules是包含PE32 Header,CLR Header,Metadata和IL代码的逻辑代码容器。并且程序集可以包含使用程序集链接器(AI.exe)链接的多个受管模块。但VS不支持多个托管模块程序集。我想知道何时以及为什么我们确实需要管理模块,如果我们不能在没有组件的情况下使用它们。我们不能只使用组件吗?

I am sure there is a logical explanation but I am not sure I know what it is :-)

我确信有合理的解释,但我不确定我知道它是什么:-)

More information about what Managed Module is: What is a Managed Module (compared to an Assembly)?

有关托管模块的更多信息:什么是托管模块(与组件相比)?

1 个解决方案

#1


4  

The diagram posted at the other question seems clear enough:

在另一个问题上发布的图表似乎很清楚:

我们为什么以及在哪里需要托管模块

Basically, you would use a Managed Module when you want to organize your code as containers within an assembly. In theory, this should give you better flexibility.

基本上,如果要将代码组织为程序集中的容器,则可以使用托管模块。从理论上讲,这应该会给你更好的灵活性。

In practice, this hardly ever happens, as most folks organize their solutions as a collection of Projects, each having its own associated DLL. This arrangement allows you to physically swap out the DLL without having to replace the entire (multiple module) assembly.

在实践中,这几乎不会发生,因为大多数人将他们的解决方案组织为一组项目,每个项目都有自己的相关DLL。这种安排允许您在不必更换整个(多模块)程序集的情况下实际交换DLL。

#1


4  

The diagram posted at the other question seems clear enough:

在另一个问题上发布的图表似乎很清楚:

我们为什么以及在哪里需要托管模块

Basically, you would use a Managed Module when you want to organize your code as containers within an assembly. In theory, this should give you better flexibility.

基本上,如果要将代码组织为程序集中的容器,则可以使用托管模块。从理论上讲,这应该会给你更好的灵活性。

In practice, this hardly ever happens, as most folks organize their solutions as a collection of Projects, each having its own associated DLL. This arrangement allows you to physically swap out the DLL without having to replace the entire (multiple module) assembly.

在实践中,这几乎不会发生,因为大多数人将他们的解决方案组织为一组项目,每个项目都有自己的相关DLL。这种安排允许您在不必更换整个(多模块)程序集的情况下实际交换DLL。