COM object executing location

G

Guest

Hi,

I built a COM object in VB .NET 2003 but can't find a way for the COM
object to determine its executing location. The COM object requires some
configuration and the COM object must find the configuration file, with will
be in the same folder as the DLL, but without hard coding the path. The COM
object will be called from ASP.

Below are the two solutions I've tried but each triggers an error when
called from ASP.

1. Doing a Registry search of HKEY_CLASSES_ROOT for the COM object's CLSID
to get the BaseCode value but Registry access is prohibited.

2. Defining an Assembly object to get the CodeBase property:

Dim ThisAssembly As [Assembly] = _
System.Reflection.Assembly.GetExecutingAssembly

but it causes "An exception type 'mscorlib: URI formats are not supported' "

Thank you for whatever help you provide,

Scott
 
M

Mattias Sjögren

Scott,
2. Defining an Assembly object to get the CodeBase property:

Dim ThisAssembly As [Assembly] = _
System.Reflection.Assembly.GetExecutingAssembly

but it causes "An exception type 'mscorlib: URI formats are not supported' "

Try checking the Location property instaed of CodeBase.

Me.GetType().Assembly.Location


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top