2. If the assembly has already been loaded, the runtime will use the loaded assembly.
3. The loader checks the GAC, and if it finds the assembly, it loads it.
4. The runtime then follows certain probing rules, first looking in the location specified by
a
element in a config file or publisher policy. The loader attempts to locate
the file based on the location, the assembly name, culture information, and version.
5. If the loader can??™t locate the assembly after probing for it, an error is thrown.
CHAPTER 5 n VB 2008 AND THE CLR 94
When architecting your application, keep in mind that there??™s overhead when locating
and loading assemblies. This is something to consider when it comes to deciding on the number
of assemblies you want to create. As you can see, versioning plays a key role at assembly
load time, and all assemblies are versioned. Versioning is something that was built into the
CLR loader from the beginning and removes the affliction, affectionately known as DLL Hell,
which occurs when replacing a shared DLL with a newer version breaks applications that use
the older version. In the CLR, multiple versions of the same assembly can exist simultaneously
on the same machine without conflicting with each other. Moreover, applications can choose
to default to using the most recent version of an assembly on the machine, or you can specify
the exact version by applying a version policy in the relevant configuration files.
Pages:
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183