Unable to debug VSIX project

与世无争的帅哥 提交于 2019-12-17 19:38:22

问题


I'm trying to develop my first visual studio extensions project, I have VS10 SDK installed and was able to create a new project and can build it fine, however when I attempt to debug symbols are not loaded. I know that I can debug to VSIX project since I have downloaded a sample project online and it symbols are loaded and break points are being hit fine http://weshackett.com/2009/11/configure-vsix-project-to-enable-debugging/). So must be something specifically to do with the way I have created the VSIX project ( maybe !). One thing I do notice is that the dll and files aren't being copied over to the local "Application Data" area, only the manifest is being copied over, while for the sample project, all files are being copied over including the dll. I have compared project settings between both and they are both the same. I hope it makes sense, if I can provide any more detail then let me know...


回答1:


OK I managed to get it working. In order to do so, I had to unload the vsix project and edit the file as an xl document.

Either remove the following lines from the project file:

<IncludeAssemblyInVSIXContainer>
    false
</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>
    false
</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>
    false
</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>
    false
</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>
    false
</CopyOutputSymbolsToOutputDirectory>

or set them to true:

<IncludeAssemblyInVSIXContainer>
    true
</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>
    true
</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>
    true
</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>
    true
</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>
    true
</CopyOutputSymbolsToOutputDirectory>

or add them under the ... node if they don't exist.

Once I removed these lines and rebuilt the solution, the dll and pdb were copied now as expected to the bin\debug folder as well as to the "AppData\Local\Microsoft\VisualStudio\10.0Exp\Extensions\" folder.




回答2:


I ran into something simular in Visual Studio 2017. The options described by @Rubans don't seem to be necessary (anymore?).

In your current build configuration (Most likely Debug), you need to make sure, that Deploy VSIX content to experimental instance for debugging is checked in the Vsix property page:




回答3:


I had the same looking issue - debugging would start but wherever I would set a breakpoint I'd see it "useless" and with "breakpoint will not be hit" annotation. I checked all the stuff in the other answers here and then I found a "contributor guide" in one plugin project repository (permalink to specific version).

So what helped me was the following: open the project properties, and on the "Debug" tab ensure that:

  1. "Start action" is set to "Start external program" and the path matches the path to devenv.exe - such as "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" - that's what it was by default.

  2. "Start options" had "command line arguments" set to /rootsuffix Exp - that was missing by default and I had to add it.

So once I added /rootsuffix Exp it would start working - next time I pressed F5 the breakpoints in the plugin code would work.



来源:https://stackoverflow.com/questions/7767249/unable-to-debug-vsix-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!