谁能详细解释一下所谓codebase方式?谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/07 00:40:41
软件开发问题!请详细解释!
楼下的回答很详细 谢谢 但是能否更通俗些 谢谢

使用<codeBase>元素
前面介绍过,程序集存放在两个地方:一个是在GAC或应用程序目录下的直接或间接子目录中;另一个位置可能在计算机、网络或Web站点中的某处,运行库将对其进行查找。当然,这需要指定程序集的确切位置。可以使用<codeBase>元素来实现,举例如下:

<configuration>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="libs" />

<dependentAssembly>

<assemblyIdentity name="MathLibrary"

publicKeyToken="99cb5ad97d1088c5" />

<bindingRedirect oldVersion="1.0.550.39732"

newVersion="1.0.550.41003" />

<codeBase version="1.0.550.41003"

href="file://d:/MathLibrary.dll" />

</dependentAssembly>

</assemblyBinding>

</runtime>

</configuration>

类似于<bindingRedirect>元素,<codeBase>也是<dependentAssembly>的子元素。通过设置href特性告知运行库按