?
Solved

Get the path of a dll

Posted on 2007-03-28
1
Medium Priority
?
224 Views
Last Modified: 2011-10-03
Hi you experts.
I want to be able to get the path of a dll. Let me explain the senario.
I have developed a windows application in order to test the dll. The dll must load some parameters from an xml file that is in the same folder. All i want is to get the path that the dll exists so i can load the xml file.

Any ideas of how can i do that?

Thank you all in advance
0
Comment
Question by:adktd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
DarrenD earned 200 total points
ID: 18806661
Here is one way,

Imports System.Xml

Dim oXMLDOMDoc As New XmlDocument
Dim sURIPath, sAbsolutePath As String
Dim uu As Uri

sURIPath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase
uu = New Uri(sURIPath)

' Get the local path from the URIPath.
sAbsolutePath = uu.LocalPath

'Open XML Configuration File and load it into the XMLDocument object.
oXMLDOMDoc.Load(sAbsolutePath & ".Config")

Cheers,

Darren
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question