Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Resource Manager Question

Reply
Thread Tools

Resource Manager Question

 
 
JezB
Guest
Posts: n/a
 
      05-21-2004
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.GetExecutingAsse mbly());

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 ?


 
Reply With Quote
 
 
 
 
Kent Boogaart
Guest
Posts: n/a
 
      05-21-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.GetExecutingAsse mbly());
>
> 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 ?
>
>



 
Reply With Quote
 
 
 
 
JezB
Guest
Posts: n/a
 
      05-21-2004
That seems to work !
Cheers.

"Kent Boogaart" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.GetExecutingAsse mbly());
> >
> > 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 ?
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resource manager problem: naming for embedded resource. Dirc Khan-Evans ASP .Net 1 10-17-2005 12:52 PM
The system cannot locate the resource specified. Error processing resource avishosh XML 2 08-08-2004 06:28 AM



Advertisments