473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

GetCallingAssembly in BaseClasses

Hello,

If you want to have the Assembly who is Calling a certain Method in another one, you use 'GetCallingAssembly'.
So far no problem.
However:

If you have the following Architecture:

Library-Assembly

myLibrary (Root NS)

Class BaseClass

Methods X, Y, Z

End Class

Class ChildOne
Inherits BaseClass

Methods A, B, C

End Class

Class ChildTwo
Inherits BaseClass

Methods D, E, F

End Class

........

Running Project

myProject

References myLibrary

Calls a method in myLibrary

If you Determine the 'GetCallingAssembly' in SubClass ChildOne or SubClass ChildTwo, then you get a refence to 'myProject' which is correct.
If you Determine the 'GetCallingAssembly' in the BaseClass, then you get a refence to 'myLibrary' (which, in a certain way, is also correct). But here I would also like to "have" 'myProject'.

So I thought: Let's be "smart" and have "Me.GetType.Assembly.GetCallingAssembly.GetCalling Assembly" (in the BaseClass), but helas, that still returns 'myLibrary'.

Is there a way to find out who called a method in a Derived Class by the BaseClass?

TIA,

Michael
Nov 20 '05 #1
1 1404
Hi Chris,

I reviewed the thread and find there is a similar issue in the group below.
Subject: Return-Type in Base & Inherited Class
Newsgroups: microsoft.public.dotnet.languages.vb

I have replied in that group and you may try to take a look.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vera | last post by:
Hi, I have a very annoying problem, with which I NEED HELP DESPERATELY!! It smells like a bug to me, but I'm not sure. SITUATION This description is a very much simplified version of the real...
3
by: Kelmen Wong | last post by:
Greeting, I'm working on a class managing resources (satelite). public CResMgr() { Assembly objClient = Assembly.GetCallingAssembly(); _objResMgr = new...
1
by: endo55 | last post by:
Hi I've got the following errors when trying to compile a program cvision error LNK2001: unresolved external symbol _IID_IGraphBuilde cvision error LNK2001: unresolved external symbo...
2
by: Marty | last post by:
Hi, I am using C#.NET 2003. First step: When I call System.Reflection.Assembly.GetCallingAssembly().GetName().Name; in debug mode from the IDE, I get a specific Assembly name. Second step:...
0
by: Shawn Hogan | last post by:
I'm getting two different results when I call System.Reflection.Assembly.GetCallingAssembly when compiling in Release and debug modes. When i compile my application using the "Debug" configuration...
1
by: Schorschi | last post by:
I have 3 assemblies... the application, a common assembly (classlibrary), and a resource assembly (classlibrary). When the common Assembly calls a function in the resource assembly, in the...
6
by: Qwert | last post by:
Hello, when you have a shared variable in a baseclass, and you give it a value through an instance of a subclass, does this shared variable and its value still exist after you destroy all...
6
by: Hareth | last post by:
When i build the sample app baseclasses (that came with winfx sdk) i get an error: Error 1 fatal error LNK1181: cannot open input file 'strmiids.lib' BaseClasses I know where the 'strmiids.lib'...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.