locked
How can an extension discover where its vsix manifest was loaded from? RRS feed

  • Question

  • I want my extension to be able to discover if the visual studio instance that is running it is an experimental instance or not.  I want the extension to find out the location of the folder it was loaded from. Which presumably is the location of the .vsixmanifest file. The purpose being to be able to create a runlog type file in a folder located in the folder of the extension vsix file.  How does an extension discover the location of its vsix manifest file?

    thanks,

    Wednesday, February 15, 2012 8:37 PM

Answers

  • Hi Steve,

    Generally speaking, a VSIX package will be deploy into %LocalAppData%\Microsoft\VisualStudio\10.0\Extensions\Company\Product\Version\. If we are using Exp Hive, it will be installed into %LocalAppData%\Microsoft\VisualStudio\10.0 Exp\Extensions\Company\Product\Version\.  And if we want set the addin as <AllUser>, the package will be installed into \Visual Studio installation folder\Common7\IDE\Extensions\Company\Product\Version\. Please note, there is not supported for Exp Hive to install the VSIX for all user, it will ignor the <AllUser> property.

    Therefore, we can check the assembly path to know, which kind of vs instance is hosted. You can get current assembly path by using reflection. See http://msdn.microsoft.com/en-us/library/system.reflection.assembly.aspx.

    If I misunderstand you, please let me know.

    Regards,

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Steve Richter Thursday, February 16, 2012 2:56 PM
    Thursday, February 16, 2012 8:48 AM