Hi Jim ,
Thank you for the response. As for the "dependentAssembly" method, I've
done some test on my side. It does can specify a certain location path for
the dotnet runtime to find the required assembly. For example, I made a
strong-named assembly "GenericComponent.dll" ,version "1.0.0.1", then in
the ASP.NET web application's web.config file, I set as below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="GenericComponent"
publicKeyToken="003114443600b39f" culture="" />
<codeBase version="1.0.0.1"
href="F:\workspace\GenericComponent\bin\debug\Gene ricComponent.dll"
/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
...................
</system.web>
</configuration>
When run the page which called the classes in the dll, it did found it. You
may try checking the Assembly's name version or keyToken attributes to see
whether they were set as the correct value.
In addition, as for the problem you mentioned at start that you want to use
a http web url such as "http://mysite/sharedbin/xxx.dll" to locate the
assembly, I think there'll some limits if you are using the ASP.NET1.1. In
DOTNET, if you specify a assembly's location via weburl in configuration
file, when running , the runtime will try to download the assembly from the
url. Also, every AppDomain have an property named "DisallowCodeDownload"
which determines whether such operation is permitted. It can be get via :
"System.AppDomain.CurrentDomain.SetupInformation.D isallowCodeDownload".
However, this property is set as "true" by default in dotnet 1.1 and didn't
provide any setting to change it in web.config or machine.config file. So
if you want to use the http web url to locate the assembly, maybe you need
to use some workaround to download the assembly manually. For example, use
the "WebClient" class to download the assembly, or specify the asp.net web
application to use the framework1.0. Here is some kb for them:
http://support.microsoft.com/?id=820106
BTW, since to use the web url location will caused so many problems, would
you consider that use a normal file path such as
"c:\foldername\assembly.dll" to specify the "codeBase" of the assembly.
Thus, you also can let serveral different web applications to share the
same folder(with those public assemblies). You just need to set the path in
the <dependentAssembly> element within the web.config file.
Please check out the preceding suggestions. If you have any questions on
them, please feel free to let me know.
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)