Is there a way to get the currently executing function/sub fully qualified
name for an assembly using reflection? e.g. "MyProject.MyClass.MyFunction"

TIA!

Re: reflection question by Tim

Tim
Thu Jul 21 17:11:54 CDT 2005

There are a couple different ways to get the method name. Here is one...

Dim fullMemberName As String
Dim mb As MethodBase = System.Reflection.MethodBase.GetCurrentMethod()
fullMemberName = mb.DeclaringType.FullName + "." + mb.Name

--
Tim Wilson
.Net Compact Framework MVP

<param@community.nospam> wrote in message
news:e2yyz4jjFHA.2472@TK2MSFTNGP15.phx.gbl...
> Is there a way to get the currently executing function/sub fully qualified
> name for an assembly using reflection? e.g. "MyProject.MyClass.MyFunction"
>
> TIA!
>
>



Re: reflection question by param

param
Sat Jul 23 11:21:21 CDT 2005

What about a way to get the method name on the calling assembly? e.g. I have
2 assemblies. 1 method in Assembly #1 calls a method in Assembly #2. Is
there anyway the method in Assembly #2 can know method name in Assembly #1?

thanks

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:OyOcOEkjFHA.3448@TK2MSFTNGP12.phx.gbl...
> There are a couple different ways to get the method name. Here is one...
>
> Dim fullMemberName As String
> Dim mb As MethodBase = System.Reflection.MethodBase.GetCurrentMethod()
> fullMemberName = mb.DeclaringType.FullName + "." + mb.Name
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> <param@community.nospam> wrote in message
> news:e2yyz4jjFHA.2472@TK2MSFTNGP15.phx.gbl...
>> Is there a way to get the currently executing function/sub fully
>> qualified
>> name for an assembly using reflection? e.g.
>> "MyProject.MyClass.MyFunction"
>>
>> TIA!
>>
>>
>
>



Re: reflection question by Tim

Tim
Sat Jul 23 12:09:31 CDT 2005

That could be accomplished like this (from the called method in assembly
2)...

Dim trace As New StackTrace(1)
Dim mb As MethodBase = trace.GetFrame(0).GetMethod()
MessageBox.Show(mb.DeclaringType.FullName + "." + mb.Name)

--
Tim Wilson
.Net Compact Framework MVP

<param@community.nospam> wrote in message
news:uQFDRL6jFHA.3656@TK2MSFTNGP09.phx.gbl...
> What about a way to get the method name on the calling assembly? e.g. I
have
> 2 assemblies. 1 method in Assembly #1 calls a method in Assembly #2. Is
> there anyway the method in Assembly #2 can know method name in Assembly
#1?
>
> thanks
>
> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
> news:OyOcOEkjFHA.3448@TK2MSFTNGP12.phx.gbl...
> > There are a couple different ways to get the method name. Here is one...
> >
> > Dim fullMemberName As String
> > Dim mb As MethodBase = System.Reflection.MethodBase.GetCurrentMethod()
> > fullMemberName = mb.DeclaringType.FullName + "." + mb.Name
> >
> > --
> > Tim Wilson
> > .Net Compact Framework MVP
> >
> > <param@community.nospam> wrote in message
> > news:e2yyz4jjFHA.2472@TK2MSFTNGP15.phx.gbl...
> >> Is there a way to get the currently executing function/sub fully
> >> qualified
> >> name for an assembly using reflection? e.g.
> >> "MyProject.MyClass.MyFunction"
> >>
> >> TIA!
> >>
> >>
> >
> >
>
>