I have an add-in loaded, and a solution loaded, how would I find the folder path of that solution programmatically in C# in my addin?
Did you know you can right click on the tab in the code editor window to access the file path or to open the folder in Windows Explorer? Check it out. By default, the file path for Visual Studio projects is very long.
What are Visual Studio Solution Folders? In Visual Studio, you can add virtual folders to group and organize your projects and files. Folders can be nested, collapsed, expanded, and even hidden in the Solution Explorer. Please keep in mind that these folders are entirely virtual.
Alas I figured it out after a lot of goooogling!!
In connect.cs:
public String SolutionPath()
{
return Path.GetDirectoryName(_applicationObject.Solution.FullName);
}
The Solution.FullName answer is correct, but take care, you cannot access it until the OnStartupCompleted method is called in connect.cs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With