简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM