1

NOW I use this wayadd folder in .VSIX package.

<Content Include="..\..\MyContentFiles\**\*.*">
  <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

After I installed the VSIX, I can find extension in this path \Users<UserName>\Appdata\Local\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\<GPName> but I can't get the folder path in vsix code(some python script in this folder,the extension need get this folder install path).

I try use :

System.AppDomain.CurrentDomain.BaseDirectory, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName,
System.Environment.CurrentDirectory,
System.IO.Directory.GetCurrentDirectory,
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase

but they all return this path

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE...

so how to get vsix install path and how to use content in .VSIX?

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68
leozhwang
  • 61
  • 4

1 Answers1

3

The question has been solved now.

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

leozhwang
  • 61
  • 4