Re: Locate assemblies in ASP.NET

Discussion in 'ASP .Net' started by Alvin Bruney, Jul 18, 2003.

  1. Alvin Bruney

    Alvin Bruney Guest

    look into machine.config file
    "Hilton" <> wrote in message
    news:02a701c34d05$7bba5490$...
    > 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
    >
    >
    >
    >
    >
     
    Alvin Bruney, Jul 18, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Terry McKiernan
    Replies:
    0
    Views:
    1,380
    Terry McKiernan
    Jul 7, 2003
  2. Najatte
    Replies:
    0
    Views:
    308
    Najatte
    Mar 10, 2006
  3. mark4asp
    Replies:
    4
    Views:
    529
  4. bienwell
    Replies:
    2
    Views:
    381
  5. sp1dEr
    Replies:
    0
    Views:
    144
    sp1dEr
    Aug 1, 2005
Loading...

Share This Page