Resource Manager Question

Discussion in 'ASP .Net' started by JezB, May 21, 2004.

  1. JezB

    JezB Guest

    I have an assembly eg. myProject in which I call a class method in a library
    assembly WinLib. Within that method I want to read a resource file from the
    calling class's assembly (rather than within the WinLib assembly itself).
    The code
    ResourceManager man = new
    ResourceManager(resxName,Assembly.GetExecutingAssembly());

    tries to open the resource file from the WinLib assembly. How can I redirect
    it to the myProject assembly (or whatever assembly called the library
    routine) ?

    Do I have to pass in the full name of the calling assembly or can it be
    obtained within WinLib generically ?
     
    JezB, May 21, 2004
    #1
    1. Advertising

  2. JezB,

    There may be a more elegant solution to this but here is my late night one:

    StackTrace st = new StackTrace(1);
    Assembly a = st.GetFrame(0).GetMethod().DeclaringType.Assembly;

    //now use a

    HTH,
    Kent

    "JezB" <> wrote in message
    news:...
    > I have an assembly eg. myProject in which I call a class method in a

    library
    > assembly WinLib. Within that method I want to read a resource file from

    the
    > calling class's assembly (rather than within the WinLib assembly itself).
    > The code
    > ResourceManager man = new
    > ResourceManager(resxName,Assembly.GetExecutingAssembly());
    >
    > tries to open the resource file from the WinLib assembly. How can I

    redirect
    > it to the myProject assembly (or whatever assembly called the library
    > routine) ?
    >
    > Do I have to pass in the full name of the calling assembly or can it be
    > obtained within WinLib generically ?
    >
    >
     
    Kent Boogaart, May 21, 2004
    #2
    1. Advertising

  3. JezB

    JezB Guest

    That seems to work !
    Cheers.

    "Kent Boogaart" <> wrote in message
    news:%...
    > JezB,
    >
    > There may be a more elegant solution to this but here is my late night

    one:
    >
    > StackTrace st = new StackTrace(1);
    > Assembly a = st.GetFrame(0).GetMethod().DeclaringType.Assembly;
    >
    > //now use a
    >
    > HTH,
    > Kent
    >
    > "JezB" <> wrote in message
    > news:...
    > > I have an assembly eg. myProject in which I call a class method in a

    > library
    > > assembly WinLib. Within that method I want to read a resource file from

    > the
    > > calling class's assembly (rather than within the WinLib assembly

    itself).
    > > The code
    > > ResourceManager man = new
    > > ResourceManager(resxName,Assembly.GetExecutingAssembly());
    > >
    > > tries to open the resource file from the WinLib assembly. How can I

    > redirect
    > > it to the myProject assembly (or whatever assembly called the library
    > > routine) ?
    > >
    > > Do I have to pass in the full name of the calling assembly or can it be
    > > obtained within WinLib generically ?
    > >
    > >

    >
    >
     
    JezB, May 21, 2004
    #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. gh0st54
    Replies:
    0
    Views:
    349
    gh0st54
    Jan 29, 2005
  2. Martin Bischoff

    custom resource manager in ASP.NET 2.0

    Martin Bischoff, Aug 31, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    6,376
    Martin Bischoff
    Sep 1, 2005
  3. Dirc Khan-Evans
    Replies:
    1
    Views:
    927
    Karl Seguin
    Oct 17, 2005
  4. padma
    Replies:
    0
    Views:
    366
    padma
    Oct 3, 2007
  5. Metalone
    Replies:
    0
    Views:
    364
    Metalone
    Jan 6, 2010
Loading...

Share This Page