I'm not able to debug the simplest possible VS Package in the simplest possible VSIX Project.
Steps to reproduce:
Create a VSIX project: File / New / Project / Extensibility / VSIX Project
Add Visual Studio Package: right-click the project node in Solution Explorer and select Add / New Item / Extensibility / Visual Studio Package
Open the newly created package file (
VSPackage1.cs
) and put a breakpoint on line 68, the first line ofInitialize()
,base.Initialize()
Press
F5
to start debugging
This launches an experimental instance of Visual Studio 2015, with the package installed (confirmed in Tools / Extensions and Updates...), but the breakpoint is disabled:
The above steps are from the Getting Started guide (index.html
) of a freshly created VSIX Project, so it should have worked.
Additional info:
- The solution configuration is Debug, platform is Any CPU
- The Debug properties of the project automatically have Start external program set to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
and Command line arguments set to/rootsuffix Exp
- I set Copy Debug Symbols to Output Directory to
True
, and after that theprojectname.pdb
file correctly appeared inbin\Debug
- The
bin\Debug\projectname.vsix
file containsprojectname.pdb
- The project is included in Assets in
source.extension.vsixmanifest
withType=Microsoft.VisualStudio.VsPackage
- I tried adding the project in Assets in
source.extension.vsixmanifest
withType=Microsoft.VisualStudio.MefComponent
but that didn't seem to do much. On the first run after this, the breakpoints appeared enabled, but were not hit. On the 2nd and subsequent runs the breakpoints went back to disabled state during running. - I tried changing the version in the manifest, but I notice any effect.
- I tried running the experimental instance separately, and attaching to it with the debugger, but that behaved the same way as when launching directly with
F5
, no difference whatsoever. - I tried adding
Console.WriteLine
statements in theInitialize
method, but I couldn't find the debugging texts in theOutput
window. - I tried x86 platform instead of Any CPU, but same result.
- A colleague followed the same steps and got the same result, so it's probably not specific to my computer. (I invite anyone to please follow the same steps and prove me wrong, or to spot the mistakes in my steps.)
All this seems to suggest that the VS Package is not getting initialized, though it is clearly installed. What am I missing? In case it's relevant, here's the source code of the VS Package, and here's the entire dummy project.
If you need more information, please let me know.