Reputation: 9783
I want to get the project directroy from an Add-In. But if I use the following code:
string projectDir = Directory.GetCurrentDirectory();
it returns C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\
How can I get the Project Directory of the project that uses the Add-In?
Upvotes: 3
Views: 4569
Reputation: 9783
I finally found a solution to my problem:
string projectDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Upvotes: 2
Reputation: 204766
See here for a list of Visual Studio variables you can use
$(ProjectDir)
gives the project directory
Upvotes: 3