Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I'm writing a plugin in C# for a CAD program used its SDK.
The plugin will be a DLL of course.

I would like to create an ini file that contain the settings of the plugin.
So I need the directory of the plugin?
How can I get that directory that contain the dll file?

Thank you in advance for your help.

A.

What I have tried:

I have tried to look for a solution on the web. But I haven't found yet.
Posted
Updated 14-Jun-17 7:38am

1 solution

You can use:
C#
Assembly.GetExecutingAssembly().CodeBase
But it will need some cleaning up, as it starts with "file:///".
See here for more information: Assembly.CodeBase Property (System.Reflection)[^]
 
Share this answer
 
Comments
RickZeeland 15-Jun-17 15:26pm    
And ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900