I am making changes to the Visual Studio wizard, which creates a project from a template, and it needs to add an assembly reference for the project, which is also in the extension directory. Therefore, I need to install <hintpath>.
I was not able to figure out how a working VS extension can detect its extension directory, which is a directory name like this:
% USERPROFILE% \ AppData \ Local \ Microsoft \ VisualStudio \ 10.0 \ Extensions \ mycomp \ myExtension
Using System.Reflection.Assembly.GetExecutingAssembly().CodeBasegives:
"C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ myCompany.myExtension \ v4.0_1.0.0.0__936015a19c3638eb \ myCompany.myExtension.dll"
Unfortunately not useful. Usage is GetCallingAssembly()not better - it points to another directory in MSIL_GAC.
Is there a Visual Studio interface that returns this information? I could not find him.
If this is not possible, is it possible, at least, to determine whether the extension in the experimental instance works against the non-experimental one? I could use this information to find a directory of extensions.
source
share