<section> and <modules>

Topics: CAB & Smart Client Software Factory
Sep 25, 2007 at 3:39 AM
What is the differences between <section> and <modules>? The config #1 and #2 are the same?

#1.

<SolutionProfile xmlns="http://schemas.microsoft.com/pag/cab-profile/2.0">
<Section Name="UserManagement">
<Modules>
<ModuleInfo AssemblyFile="UserManagement.Module.dll" />
</Modules>
</Section>
<Section Name="WTS">
<Modules>
<ModuleInfo AssemblyFile="AA.Module.dll" />
</Modules>
</Section>
</SolutionProfile>

And

#2.

<SolutionProfile xmlns="http://schemas.microsoft.com/pag/cab-profile/2.0">
<Section Name="AA">
<Modules>
<ModuleInfo AssemblyFile="UserManagement.Module.dll" />
<ModuleInfo AssemblyFile="AA.Module.dll" />
</Modules>
</Section>
</SolutionProfile>
Developer
Sep 25, 2007 at 2:23 PM
Hi

I answer you inline.


What is the differences between <section> and <modules>?

The node <section> allows to group a set of modules under a same name. This help to express the dependencies, for example:

<Section Name="Infrastructure">
<Modules>
    <ModuleInfo AssemblyFile="GlobalBank.Support.Module.dll" />
    <ModuleInfo AssemblyFile="GlobalBank.Infrastructure.Module.dll" />
</Modules>
</Section>
<Section Name="BranchSystems">
    <Dependencies>
        <Dependency Name="Infrastructure" />
    </Dependencies>
    <Modules>
        <ModuleInfo AssemblyFile="GlobalBank.BranchSystems.Layout.dll" Name="BranchSystems.Layout"/>
        <ModuleInfo AssemblyFile="GlobalBank.BranchSystems.Module.dll" Name="BranchSystems.Module">
                <Dependencies>
                    <Dependency Name="BranchSystems.Layout" />
                </Dependencies>           
        </ModuleInfo>
    </Modules>
</Section>
in the previous code the section whose name is “BranchSystems” depends on the section “Infrastructure”. Therefore all the modules of the section “Infrastructure” will be loaded before those of the section “BranchSystems”.
Also it is possible to be expressed specific dependencies for each module in individual. In the example the module whose name is “BranchSystems.Module” also depends on the module “BranchSystems.Layout”.


The config #1 and #2 are the same?

In your example the behavior of the application is the same for both.

You’d probably like to see this post: New Module Loader for CAB .

Please let me know if this helps!

Mariano Converti
http://staff.southworks.net/blogs/mconverti/
Sep 26, 2007 at 1:48 AM
Thanks. Mariano I will take a look the link you gave me.. For the time being, my company blocked that site.. I will take a look at home..