locked
Refer to the directory of a class library project RRS feed

  • Question

  • I know that I can refer to the startup directory of a .NET executable with "Application.StartupPath" but is there something similar that I can use to refer to the directory that contains the .dll file for a class library?  Thanks!

    -Dave

    Monday, October 2, 2006 4:06 AM

Answers

  • How about -

    Dim dlinf As New System.Reflection.TypeDelegator(Me.GetType())

    Dim loc As String = dlinf.Assembly.Location

    Rgds,

    Martin.

    Monday, October 2, 2006 4:22 AM

All replies

  • How about -

    Dim dlinf As New System.Reflection.TypeDelegator(Me.GetType())

    Dim loc As String = dlinf.Assembly.Location

    Rgds,

    Martin.

    Monday, October 2, 2006 4:22 AM
  • Hello again,

    I just recently realised that this is going the long way round - and regardless of it now hitting the forum list - I thought you might be interested to know that TypeDelgator is simply inheriting the information from the system type so -

    ' using [me | this] but any class instantiated instance will be appropriate

    Dim AssemblyLocation As String = Me.GetType().Assembly.Location

    is sufficent to meet the original requirement.

    Rgds,

    Martin.

    Hopefully we are all constantly learning.

    Tuesday, October 10, 2006 4:57 AM