4

Is it possible to include some predefined files in the VSIX container and then access them by the extension?

Spook
  • 25,318
  • 18
  • 90
  • 167

2 Answers2

5

In Solution Explorer, right click the file and open Properties pane.

Set Include in VSIX = true

Include in VSIX

Alper Ebicoglu
  • 8,884
  • 1
  • 49
  • 55
3

In the .vsixmanifest designer select Assets - New - Select type and file name. Or directly edit .vsixmanifest Assets node. These files will be deployed to the same directory as the main extension dll.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • Cool! One more question: is there a way to get the path of extension directory other than `System.Reflection.Assembly.GetExecutingAssembly().CodeBase` ? – Spook Apr 16 '14 at 12:09
  • I don't know an other way and personally use GetExecutingAssembly().Location too. – Sergey Vlasov Apr 16 '14 at 12:12
  • 6
    It's even simpler :) There's an option "Include in VSIX" in Properties Pane (or maybe it appears after adding a file to manifest?) – Spook Apr 16 '14 at 12:31
  • 1
    @Spook, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) after 8 years :) – Ali CAKIL Aug 13 '22 at 22:08