How do I get the path of the current assembly? I need to get data from some paths relative to the location of hte current assembly (.dll).
I thought someone told me to use the reflection namespace but I can’t find anything in there.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use:
Some suggestions in the comments are to pass that through
System.Uri.UnescapeDataString(from vvnurmi) to ensure that any percent-encoding is handled, and to usePath.GetFullpath(from TrueWill) to ensure that the path is in standard Windows form (rather than having slashes instead of backslashes). Here’s an example of what you get at each stage:Output if we’re running
C:\Temp\Temp App\bin\Debug\TempApp.EXE: