Search code examples
c#.netvisual-studiovsixvisual-studio-addins

VSIX extension adding assembly reference to project


Im building an extension that should be able to add an assembly to a projects references

This assembly is included with the VSIX

Is including the assembly with the VSIX a good idea ? How do I get the path to the assembly that was distributed with the VSIX ?


Solution

  • To get the deployment directory of your VSIX extension, you can use the following code:

    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
    

    Then just add your assembly name to this path.