[asp.net 2.0] extern aliases

Discussion in 'ASP .Net' started by SirMike, Jan 19, 2007.

  1. SirMike

    SirMike Guest

    Hello,

    I have got two assembly in web application's Bin folder. There is a
    class in both of them with the same namespace and a name. Ofcourse there
    is totally different code in them and I cannot recompile.
    I know that I can add /reference option to the compiler and make an
    extern alias in my aspx.cs file.
    The problem is when I pass the /reference:Alias=name.dll I have got the
    message from a compiler that this assembly is already referenced. I
    suppose that it's automatically referenced by the compiler because it's
    in Bin directory.
    So, I tried to move it away from Bin folder and refrence the new folder.
    It compiles in the Visual Studio but when page is loading I have got
    another error: "Could not load file or assembly: name.dll
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
    dependencies"

    Can somebody give me a hint how to solve it?

    --
    SirMike - http://www.sirmike.org
    C makes it easy to shoot yourself in the foot;
    C++ makes it harder, but when you do, it blows away your whole leg. -
    Bjarne Stroustrup
    SirMike, Jan 19, 2007
    #1
    1. Advertising

  2. SirMike

    bruce barker Guest

    the aspnet_compiler.exe (compiles the aspx pages) does not support the
    reference switch. i can think of a couple options:

    1) write a wrapper class for one of the dlls, that loads the dll at
    runtime. you can change the dll extension so its not automatically loaded.

    2) host one of the dlls in a webservice

    3) decompile the dll, change the namespace and recompile.


    -- bruce (sqlwork.com)

    SirMike wrote:
    > Hello,
    >
    > I have got two assembly in web application's Bin folder. There is a
    > class in both of them with the same namespace and a name. Ofcourse there
    > is totally different code in them and I cannot recompile.
    > I know that I can add /reference option to the compiler and make an
    > extern alias in my aspx.cs file.
    > The problem is when I pass the /reference:Alias=name.dll I have got the
    > message from a compiler that this assembly is already referenced. I
    > suppose that it's automatically referenced by the compiler because it's
    > in Bin directory.
    > So, I tried to move it away from Bin folder and refrence the new folder.
    > It compiles in the Visual Studio but when page is loading I have got
    > another error: "Could not load file or assembly: name.dll
    > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
    > dependencies"
    >
    > Can somebody give me a hint how to solve it?
    >
    bruce barker, Jan 19, 2007
    #2
    1. Advertising

  3. SirMike

    SirMike Guest

    bruce barker wrote:
    > the aspnet_compiler.exe (compiles the aspx pages) does not support the
    > reference switch. i can think of a couple options:
    >
    > 1) write a wrapper class for one of the dlls, that loads the dll at
    > runtime. you can change the dll extension so its not automatically loaded.
    >
    > 2) host one of the dlls in a webservice
    >
    > 3) decompile the dll, change the namespace and recompile.


    Oh, I thought it was possible. Thanks for the info.

    --
    SirMike - http://www.sirmike.org
    C makes it easy to shoot yourself in the foot;
    C++ makes it harder, but when you do, it blows away your whole leg. -
    Bjarne Stroustrup
    SirMike, Jan 19, 2007
    #3
    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. Roedy Green

    enum aliases

    Roedy Green, Jun 26, 2005, in forum: Java
    Replies:
    5
    Views:
    3,837
    Roedy Green
    Jun 30, 2005
  2. Kevin
    Replies:
    5
    Views:
    2,158
    Jack Klein
    Feb 6, 2004
  3. Thomas Matthews
    Replies:
    5
    Views:
    2,367
    tom_usenet
    Aug 2, 2004
  4. Michael Surette

    superuser access to aliases database file

    Michael Surette, Nov 26, 2003, in forum: Python
    Replies:
    0
    Views:
    284
    Michael Surette
    Nov 26, 2003
  5. Andre
    Replies:
    5
    Views:
    517
    Keith Thompson
    Jul 17, 2012
Loading...

Share This Page