Steve Johnson
Steve Johnson

Reputation: 3114

How to get Visual Studio Project (which is loaded in solution explorer) location via a Visual Studio Addin?

I am developing a Visual Studio Addin using C#. I want to determine the location on file system of a solution or a project whichever is loaded in Visual Studio, using my Addin that is also loaded.

Please suggest as how i can do this? pointer to any resource will be helpful.

Thanks

Steve

Upvotes: 0

Views: 591

Answers (1)

krawl
krawl

Reputation: 399

Using the GetDirectoryName function in the System.IO.Path namespace should get you what you need.

public String SolutionPath()
{
    return Path.GetDirectoryName(_applicationObject.Solution.FullName);
}

This was also answered here... Visual studio addin - finding current solution folder path

Upvotes: 1

Related Questions