Shmoopy
Shmoopy

Reputation: 5534

How to access a file in the dll's folder instead of the executable?

I have an executable that's using a dll (they're in 2 different folders). When I do System.IO.Directory.GetCurrentDirectory() in one of the methods in the dll, I'm getting the executable folder. Is there anyway to get the dll folder?

Upvotes: 0

Views: 200

Answers (1)

kennyzx
kennyzx

Reputation: 12993

Use Assembly.GetExecutingAssembly().Location to get the full path to the DLL.

Upvotes: 2

Related Questions