look into machine.config file
"Hilton" <nomail@intellilogic.com> wrote in message
news:02a701c34d05$7bba5490$a001280a@phx.gbl...
> Is there a way to tell ASP.NET how to locate assemblies
> within a web site?
>
> I have multiple sites which need to share .ASCX controls.
> As a control cannot be loaded from outside the
> application area, I create a virtual directory from each
> site to the shared control's directory, thus including
> the shared directory in both site's applications. The
> code for the control's base class (codebehind) is located
> in the assembly of the application and is thus in the
> application's BIN directory.
>
> My problem is that when the site loads the control it
> will generate an error indicating that it cannot load an
> instance of the base/codebehind class. It does not seem
> to be looking up the logical chain of the application &
> virtual directory to find it. (I would have expected it
> to search the virtual directories local directory first &
> associated BIN directory and then move up to the
> application level but this does not seem to occur). This
> behaviour seems to be erratic - sometimes I configure
> sites and it works fine, other times it has this problem.
>
> If the shared control is copied to a physical directory
> in the site as opposed to a virtual directory then it
> works as it should (but is obviously not shared).
>
> For example, if we have 2 sites, SITEA & SITEB and a
> directory called SAMPLE containing a .ASCX control then
> the logical layout would look like this:
>
> d:\inetpub\shared\sample\mysample.ascx
>
> /SITEA
> /BIN
> /SAMPLE (maps to sample directory)
>
> /SITEB
> /BIN
> /SAMPLE (maps to sample directory)
>
> Trying to load an instance of /sample/sample.ascx from
> either SITEA or SITEB will fail. It appears that we
> somehow need to tell the control to locate the baseclass
> in the assembly located in the site's bin directory. Is
> the control possibly looking up a physical path rather
> than a logical path to located the assembly?
>
> Any ideas?
>
> Thanks,
>
> Hilton
>
>
>
>
>