Reputation: 124648
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 of Initialize()
, 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:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
and Command line arguments set to /rootsuffix Exp
True
, and after that the projectname.pdb
file correctly appeared in bin\Debug
bin\Debug\projectname.vsix
file contains projectname.pdb
source.extension.vsixmanifest
with Type=Microsoft.VisualStudio.VsPackage
source.extension.vsixmanifest
with Type=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.F5
, no difference whatsoever.Console.WriteLine
statements in the Initialize
method, but I couldn't find the debugging texts in the Output
window.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.
Upvotes: 5
Views: 1814
Reputation: 4273
To supplement the other answer here, the solution to the OP's actual problem is:
Just ignore the message and don't worry about it. The symbols aren't loaded right now, but they'll be loaded by the time the breakpoint is ready to be hit.
Upvotes: 0
Reputation: 27880
VSPackages are loaded into Visual Studio only when their functionality is required. For example, a VSPackage is loaded when Visual Studio uses a project factory or a service that the VSPackage implements. This feature is called delayed loading, which is used whenever possible to improve performance.
To automatially load a package on VS startup, you typically add a ProvideAutoLoad attribute to your main package class.
See Loading VSPackages documentation for more details.
Upvotes: 3