
Unable to get correct assembly codebase when using COM+
I don't think you will be able to use GetCallingAssembly() in this scenario.
Your assembly is being called through COM+ runtime which involves
managed/unmanaged transition and the reflection information might not be
preserved.
How about using COM+ object construction services? They are easily
accessible via ConstructionEnabledAttribute. Hope that will work for you.
Karol, SDE
VB.NET
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Quote:
> I'm in a project where we are using several tiers and using COM+
> (Enterprise Services) in .NET. In order to use config files in the
> COM+ packages we have made a wrapper class that reads an XML-file
> placed in the packages execution path. The file is namned like
> BusinessServices.Dll.Config.
> In order to be able to get the path to the file without hardcoding it
> in each client we have implemented a method that uses
> [Assembly].GetCallingAssembly.CodeBase + ".config" to retreive the
> file name.
> The problem is that the CodeBase address is
> c:\winnt\microsoft.net\framework\v1.0.3705\mscorlib.dll.config instead
> of c:\myproject\BusinessServices\bin.
> I would like some help to be able to retreive the correct path. Any
> ideas?
> The packages is set to .Server but nothing changes when setting the
> packages to Library.
> Cheers
> Magnus