0
votes

I have developed a VS Extension (VSIX) and I need to know exactly where that Extension is installed.

I know that should be installed somewhere in this folder:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions"

However, it seems to be in a folder with a random name:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions**kwsjp3kd.f5k**"

So, my question is this: How can I install my extension in a folder with a name that I have previously selected, like this?

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions**MyExtension**"

2

2 Answers

1
votes

I am using a helper method that obtains the package installation folder from the codebase of the assembly that defines my package class...

internal static string GetPackageInstallationFolder()
{
    Type packageType = typeof(MyPackage);
    var assemblyCodeBaseUri = new Uri(packageType.Assembly.CodeBase, UriKind.Absolute);
    var assemblyFileInfo = new FileInfo(assemblyCodeBaseUri.LocalPath);
    return assemblyFileInfo.Directory.FullName;
}
0
votes

My solution:

I use this api get vsix install physical path:

string path = System.Reflection.Assembly.GetExecutingAssembly().Location;

path = \AppData\Local\Microsoft\VisualStudio\...\Extensions\[install path]\xx.dll